-
Notifications
You must be signed in to change notification settings - Fork 18
119 lines (102 loc) · 3.39 KB
/
build.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
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
name: build
on:
push:
# branches:
# - 'main'
# NOTE: pull_request tests a potential merge conflict. push builds the branch as it would build main. Both serve separate purposes.
# Especially when working with CI changes, we may want to see both, hence not limiting builds to the main branch.
pull_request:
workflow_dispatch:
# This ensures that jobs get canceled when force-pushing
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# The default Debian shell (dash) is faster than bash at running scripts,
# and using bash when it is not needed doesn't make sense.
defaults:
run:
shell: sh
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- appimage_arch: i686
- appimage_arch: x86_64
- appimage_arch: armhf
- appimage_arch: aarch64
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get git hash
run: |
echo -n "https://github.com/${GITHUB_REPOSITORY}/commit/" > src/runtime/version
git rev-parse --short HEAD | xargs >> src/runtime/version
- name: Set up QEMU integration for Docker
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Build
env:
ARCH: ${{ matrix.appimage_arch }}
run: |
# make sure to collect artifacts in a separate directory
# makes uploading easier
mkdir -p out
(cd out && ../scripts/docker/build-with-docker.sh)
- name: Sign
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
# skip signing if secret is not available (e.g., if run from a PR made by somebody outside of this repository)
if: ${{ env.SIGNING_KEY != '' }}
run: |
find out
scripts/sign.sh out/runtime-*
# copy pubkey so that it's included with the files uploaded to the release page
cp signing-pubkey.asc out/
- uses: actions/upload-artifact@v3
with:
name: artifacts
path: out/*
build-in-chroot:
runs-on: ubuntu-latest
# if: false
strategy:
fail-fast: false
matrix:
include:
- alpine_arch: x86_64
- alpine_arch: x86
- alpine_arch: armhf
- alpine_arch: aarch64
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get git hash
run: |
echo -n "https://github.com/${GITHUB_REPOSITORY}/commit/" > src/runtime/version
git rev-parse --short HEAD | xargs >> src/runtime/version
- name: Build in chroot
env:
ALPINE_ARCH: ${{ matrix.alpine_arch }}
run: |
sudo apt-get update
sudo apt-get -y install qemu-user-static
scripts/chroot/chroot_build.sh
upload:
name: Create release and upload artifacts
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Inspect directory after downloading artifacts
run: ls -alFR
- name: Create release and upload artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
chmod +x pyuploadtool-x86_64.AppImage
./pyuploadtool-x86_64.AppImage --appimage-extract-and-run artifacts/*