-
Notifications
You must be signed in to change notification settings - Fork 35
133 lines (118 loc) · 3.35 KB
/
release.yml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Release
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
on:
pull_request:
branches: master
paths:
- '**release.yml'
jobs:
dist:
runs-on: ubuntu-22.04
outputs:
rmw_version: ${{ steps.get_version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
submodules: false
- id: get_version
run: |
VERSION=$(grep "version:" meson.build | awk -F"'" '{print $2}')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Install dependencies
run: |
sudo apt install -y \
meson \
ninja-build \
xz-utils
- name:
run: |
meson setup builddir
cd builddir
meson dist --include-subprojects
cd meson-dist
REL_TAR="rmw-$VERSION.tar"
xz -d "$REL_TAR.xz"
tar --delete -f "$REL_TAR" "rmw-$VERSION/packaging"
xz "$REL_TAR"
sha256sum "$REL_TAR.xz" > "$REL_TAR.xz.sha256sum"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: rmw_dist_archive
path: ${{ github.workspace }}/builddir/meson-dist/*
build-appimage:
runs-on: ubuntu-latest
needs: dist
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
- if: ${{ ! contains(matrix.platform, 'amd64') }}
uses: docker/setup-qemu-action@v3
- name: Set variables
run: |
VERSION=${{ needs.dist.outputs.rmw_version }}
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build AppImage
run: |
docker run -t \
--rm \
--platform=${{ matrix.platform }} \
-e HOSTUID=$(id -u) \
-e VERSION \
-v $GITHUB_WORKSPACE:/workspace \
-w /workspace \
andy5995/linuxdeploy:latest packaging/appimage/pre-appimage.sh
- name: Create sha256sum
run: |
IMAGE_FILENAME=$(basename `find out/*AppImage`)
echo "IMAGE_FILENAME=$IMAGE_FILENAME" >> $GITHUB_ENV
cd out
sha256sum "$IMAGE_FILENAME" > "$IMAGE_FILENAME.sha256sum"
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: ${{ env.IMAGE_FILENAME }}
path: ./out/*
if-no-files-found: error
build-deb:
strategy:
matrix:
platform:
- amd64
- arm64
- 386
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Copy debian directory
run: cp -a packaging/debian .
- uses: andy5995/gh-action-build-deb@v1
with:
args: |
--no-sign
--compression=xz
platform: ${{ matrix.platform }}
- name: Create sha256sum
run: |
DEB_FILENAME=$(basename `find output/*deb`)
echo "DEB_FILENAME=$DEB_FILENAME" >> $GITHUB_ENV
cd output
sha256sum "$DEB_FILENAME" > "../$DEB_FILENAME.sha256sum"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.DEB_FILENAME }}
path: |
output/*.deb
*deb.sha256sum
if-no-files-found: error