-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (53 loc) · 1.56 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Build and publish snap
on:
push:
tags:
- '*'
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- ros_distro: humble
runner: ubuntu-latest
# - ros_distro: jazzy
# runner: ubuntu-latest
- ros_distro: humble
runner: ubuntu-24.04-arm64
# - ros_distro: jazzy
# runner: ubuntu-24.04-arm64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-tags: true
- name: Render snapcraft.yaml
run: |
sudo apt update
sudo apt install python3-jinja2
export ROS_DISTRO=${{ matrix.ros_distro }}
./render_template.py ./snapcraft_template.yaml.jinja2 snap/snapcraft.yaml
- name: Build snap
uses: snapcore/action-build@v1
with:
snapcraft-channel: latest/edge
id: build-snap
env:
SNAPCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS: 1
- name: Make sure the snap is installable
run: |
sudo snap install --dangerous ${{ steps.build-snap.outputs.snap }}
# Publish the snap on the store
# by default on 'edge' but on 'candidate' for tags
- name: Publish snap
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
snap: ${{ steps.build-snap.outputs.snap }}
release: ${{ matrix.ros_distro }}/${{ startsWith(github.ref, 'refs/tags/') && 'candidate' || 'edge' }}