mirror of
https://github.com/micro-ROS/micro-ROS-Agent.git
synced 2026-09-06 09:55:15 +02:00
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: snap
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
branches:
|
|
- foxy
|
|
pull_request:
|
|
branches:
|
|
- foxy
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
snap-file: ${{ steps.build-snap.outputs.snap }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: snapcore/action-build@v1
|
|
id: build-snap
|
|
with:
|
|
snapcraft-args: '--enable-experimental-extensions'
|
|
|
|
# Make sure the snap is installable
|
|
- run: |
|
|
sudo snap install --dangerous ${{ steps.build-snap.outputs.snap }}
|
|
|
|
# @todo Do some testing with the snap
|
|
- run: |
|
|
micro-ros-agent udp4
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: micro-ros-agent-snap
|
|
path: ${{ steps.build-snap.outputs.snap }}
|
|
|
|
publish:
|
|
if: github.ref == 'refs/heads/foxy' || startsWith(github.ref, 'refs/tags/')
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: micro-ros-agent-snap
|
|
path: .
|
|
- uses: snapcore/action-publish@v1
|
|
with:
|
|
store_login: ${{ secrets.STORE_LOGIN }}
|
|
snap: ${{needs.build.outputs.snap-file}}
|
|
release: ${{ startsWith(github.ref, 'refs/tags/') && 'candidate' || 'edge'}}
|