-
Notifications
You must be signed in to change notification settings - Fork 21
77 lines (67 loc) · 2.39 KB
/
arm64-rpi-image-build.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
name: arm64-rpi-image-build
on:
push:
branches: [ "master" ]
paths-ignore:
- '*.md'
- '.gitignore'
- 'images'
- 'ci/amd64/**'
- 'scripts/jam-remote'
- 'Makefile'
pull_request:
branches: [ "master" ]
paths-ignore:
- '*.md'
- '.gitignore'
- 'images'
- 'ci/amd64/**'
- 'scripts/jam-remote'
- 'Makefile'
workflow_dispatch:
jobs:
arm64-rpi-image-build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set values
id: set_values
run: |
echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV
if [[ "${{github.event_name}}" == "pull_request" ]]; then
echo "::set-output name=github_user::${{github.event.pull_request.head.repo.owner.login}}"
else
echo "::set-output name=github_user::$(echo ${{github.repository}} | cut -d'/' -f1)"
fi
- name: Display the build name
run: echo "Building the joininbox-arm64-rpi-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/amd64,linux/arm64
- name: Run the build script
run: |
echo "Running with: ${{steps.set_values.outputs.github_user}} $GITHUB_HEAD_REF"
cd ci/arm64-rpi
bash arm64-rpi.sh ${{steps.set_values.outputs.github_user}} $GITHUB_HEAD_REF
- name: Compute checksum of the raw image
run: |
cd ci/arm64-rpi
sha256sum joininbox-arm64-rpi.img > joininbox-arm64-rpi.img.sha256
- name: Compress image
run: |
cd ci/arm64-rpi
gzip -v9 joininbox-arm64-rpi.img
- name: Compute checksum of the compressed image
run: |
cd ci/arm64-rpi
sha256sum joininbox-arm64-rpi.img.gz > joininbox-arm64-rpi.img.gz.sha256
- name: Upload the image and checksums
uses: actions/upload-artifact@v3
with:
name: joininbox-arm64-rpi-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }}
path: |
${{ github.workspace }}/ci/arm64-rpi/joininbox-arm64-rpi.img.sha256
${{ github.workspace }}/ci/arm64-rpi/joininbox-arm64-rpi.img.gz
${{ github.workspace }}/ci/arm64-rpi/joininbox-arm64-rpi.img.gz.sha256