forked from kozec/sc-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
198 lines (178 loc) · 5.78 KB
/
appimage.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: Build and publish AppImages
on:
push:
branches: dev
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- platform: linux/amd64
arch: amd64
#- platform: linux/arm64
# arch: arm64
base:
#- os: ubuntu
# codename: focal
# pubkey: 871920D1991BC93C
# recipe: AppImageBuilder.ubuntu-focal.yml
- os: ubuntu
codename: jammy
pubkey: 871920D1991BC93C
recipe: AppImageBuilder.yml
#- os: ubuntu
# codename: noble
# pubkey: 871920D1991BC93C
# recipe: AppImageBuilder.yml
#- os: debian
# codename: bullseye
# pubkey: 0E98404D386FA1D9
# pubkey_security: 54404762BBB6E853
# recipe: AppImageBuilder.debian-bullseye.yml
#- os: debian
# codename: bookworm
# pubkey: 0E98404D386FA1D9
# pubkey_security: 54404762BBB6E853
# recipe: AppImageBuilder.debian.yml
#- os: debian
# codename: trixie
# pubkey: 0E98404D386FA1D9
# pubkey_security: 54404762BBB6E853
# recipe: AppImageBuilder.debian.yml
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 50
- uses: rlespinasse/github-slug-action@v4
- name: Setup qemu for docker
uses: docker/setup-qemu-action@v3
if: matrix.target.platform != 'linux/amd64'
- name: Setup buildx for docker
uses: docker/setup-buildx-action@v3
- name: Compile in docker
uses: docker/build-push-action@v5
with:
platforms: ${{ matrix.target.platform }}
outputs: build
build-args: |
BASE_OS=${{ matrix.base.os }}
BASE_CODENAME=${{ matrix.base.codename }}
- name: Prepare environment to build AppImage
env:
TARGET_PLATFORM: ${{ matrix.target.platform }}
shell: bash
run: |
set -eua
if [ -r build/.build-metadata.env ]; then
. build/.build-metadata.env
rm build/.build-metadata.env
fi
APPIMAGE_SOURCE=build
APPIMAGE_VERSION="${GITHUB_REF_SLUG}-${{ matrix.base.codename }}"
APPIMAGE_APT_ARCH="${TARGETARCH}"
APPIMAGE_APT_DISTRO="${{ matrix.base.codename }}"
APPIMAGE_APT_PUBKEY="${{ matrix.base.pubkey }}"
APPIMAGE_APT_PUBKEY_SECURITY="${{ matrix.base.pubkey_security }}"
APPIMAGE_ARCH="${TARGETMACHINE}"
printenv | grep ^APPIMAGE_ >>"${GITHUB_ENV}"
- name: Build AppImage
uses: git-developer/[email protected]
with:
command: ${{
format('sh -c "set -eu; {0}; {1}; {2}; appimage-builder --recipe {3}"',
'pip install --upgrade setuptools packaging packaging-legacy',
'pip install --extra-index-url https://lief.s3-website.fr-par.scw.cloud/latest \"lief>=0.16.0.dev0\"',
'find /usr/local/lib -name package.py | while read -r file; do sed -i -e \"s/^from.packaging/&_legacy/\" \"${file}\"; done',
matrix.base.recipe)
}}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: appimage-${{ matrix.base.codename }}-${{ matrix.target.arch }}
path: |
./*.AppImage
./*.AppImage.zsync
if-no-files-found: error
test:
runs-on: ubuntu-latest
needs:
- build
strategy:
fail-fast: false
matrix:
target:
- platform: linux/amd64
arch: amd64
base:
- os: ubuntu
codename: focal
- os: ubuntu
codename: jammy
- os: ubuntu
codename: noble
- os: debian
codename: bullseye
- os: debian
codename: bookworm
- os: debian
codename: trixie
- os: fedora
codename: "39"
- os: fedora
codename: "40"
- os: archlinux
codename: base
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: appimage-*-${{ matrix.target.arch }}
path: appimages
merge-multiple: true
- name: Setup qemu for docker
uses: docker/setup-qemu-action@v3
if: matrix.target.platform != 'linux/amd64'
- name: Setup buildx for docker
uses: docker/setup-buildx-action@v3
- name: Test AppImages
uses: docker/build-push-action@v5
with:
file: AppImageBuilder.test.Dockerfile
context: appimages
platforms: ${{ matrix.target.platform }}
build-args: |
BASE_OS=${{ matrix.base.os }}
BASE_CODENAME=${{ matrix.base.codename }}
release:
runs-on: ubuntu-latest
needs:
- build
- test
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: appimage-*
path: assets
merge-multiple: true
- name: Create checksum for release assets
shell: bash
run: |
algo="${SHA_ALGORITHM:-256}"
find assets -type f | while read -r asset; do
shasum --binary --algorithm "${algo}" "${asset}" >"${asset}.sha${algo}"
done
- name: Upload artifacts to GitHub release
uses: softprops/action-gh-release@v2
with:
draft: ${{ !startsWith(github.ref, 'refs/tags/') }}
files: assets/*