@@ -3,50 +3,72 @@ name: Create release on tag
3
3
on :
4
4
push :
5
5
tags :
6
- - " *"
7
-
8
- defaults :
9
- run :
10
- working-directory : packages/os
6
+ - ' *'
11
7
12
8
jobs :
13
- build-os :
14
- runs-on : ${{ matrix.task == 'build:amd64' && 'ubicloud-standard-16' || 'ubicloud-standard-16-arm' }}
9
+ create-release :
10
+ runs-on : 64-core-amd64
11
+ permissions :
12
+ contents : read
13
+ packages : write
15
14
defaults :
16
15
run :
17
16
working-directory : packages/os
18
- strategy :
19
- fail-fast : false
20
- matrix :
21
- task :
22
- - build:amd64
23
- - build:arm64
24
17
steps :
18
+ # Checkout
25
19
- uses : actions/checkout@v3
26
- - uses : docker/setup-buildx-action@v2
20
+
21
+ # Build Docker images
22
+ - run : echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
23
+ - run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.repository_owner }}" --password-stdin
24
+ - run : docker buildx create --use
25
+ - run : docker buildx build --platform linux/amd64,linux/arm64 --file umbrelos.Dockerfile --tag ghcr.io/${{ github.repository_owner }}/umbrelos:${{ env.VERSION }} --push ../../
26
+ - run : mkdir -p build &&docker buildx imagetools inspect ghcr.io/${{ github.repository_owner }}/umbrelos:${{ env.VERSION }} > build/docker-umbrelos-${{ env.VERSION }}
27
+
28
+ # Build OS images
27
29
- uses : actions/setup-node@v3
28
30
with :
29
31
node-version : 18
30
- - run : npm run ${{ matrix.task }}
32
+ # Awkward hack to run in parallel but correctly handle errors
33
+ - run : |
34
+ npm run build:amd64 &
35
+ pid1=$!
36
+ npm run build:arm64 &
37
+ pid2=$!
38
+ wait $pid1 || exit 1
39
+ wait $pid2 || exit 1
31
40
32
41
# TODO: Use .img.xz for all release assets once https://github.com/balena-io/etcher/issues/4064 is fixed
33
- - name : Prepare arm64 release assets
34
- if : matrix.task == 'build:arm64'
35
- run : cd build && (zip umbrelos-pi4.img.zip umbrelos-pi4.img & zip umbrelos-pi5.img.zip umbrelos-pi5.img & wait)
36
- - name : Prepare amd64 release assets
37
- if : matrix.task == 'build:amd64'
38
- run : cd build && sudo xz --keep --threads=0 umbrelos-amd64.img
42
+ - name : Compress release assets
43
+ # Awkward hack to run in parallel but correctly handle errors
44
+ run : |
45
+ cd build
46
+ zip umbrelos-pi4.img.zip umbrelos-pi4.img &
47
+ pid1=$!
48
+ zip umbrelos-pi5.img.zip umbrelos-pi5.img &
49
+ pid2=$!
50
+ sudo xz --keep --threads=0 umbrelos-amd64.img &
51
+ pid3=$!
52
+ wait $pid1 || exit 1
53
+ wait $pid2 || exit 1
54
+ wait $pid3 || exit 1
39
55
40
56
- name : Create USB installer
41
- if : matrix.task == 'build:amd64'
42
57
run : npm run build:amd64:usb-installer
43
58
59
+ - name : Create SHASUM
60
+ run : shasum -a 256 build/* | tee build/SHA256SUMS
61
+
62
+ - name : OpenTimestamps
63
+ run : npm ci && npx ots-cli.js stamp build/SHA256SUMS
64
+
44
65
- name : Create GitHub Release
45
66
uses : softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
46
67
with :
47
68
draft : true
48
69
name : umbrelOS ${{ github.ref_name }}
49
70
files : |
71
+ packages/os/build/SHA256SUMS*
50
72
packages/os/build/*.update
51
73
packages/os/build/*.img.zip
52
74
packages/os/build/*.img.xz
0 commit comments