forked from raspiblitz/raspiblitz
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (95 loc) · 4.19 KB
/
amd64-fatpack-image.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
name: amd64-fatpack-image-build
concurrency:
group: amd64-fatpack-image-build-${{ github.head_ref }}
cancel-in-progress: true
on:
workflow_dispatch:
#push:
# branches: ["dev", "v1.10"]
# paths:
# - 'build_sdcard.sh'
# - 'home.admin/bitcoin.install.sh'
# - 'home.admin/lnd.install.sh'
# - 'home.admin/cl.install.sh'
# - 'home.admin/cl-plugin.cln-grpc.sh'
# - 'home.admin/tor.install.sh'
# - 'home.admin/blitz.i2pd.sh'
# - 'home.admin/blitz.web.sh'
# - 'home.admin/bonus.nodejs.sh'
# - 'home.admin/bonus.rtl.sh'
# - 'home.admin/bonus.btcpayserver.sh'
# - 'home.admin/bonus.thunderhub.sh'
# - 'home.admin/bonus.jam.sh install'
# - 'home.admin/bonus.mempool.sh'
# - 'home.admin/blitz.web.api.sh'
# - 'home.admin/blitz.web.ui.sh'
# - 'home.admin/blitz.display.sh'
# - 'ci/amd64/**'
#pull_request:
# branches: ["dev", "v1.10"]
# paths:
# - 'build_sdcard.sh'
# - 'home.admin/bitcoin.install.sh'
# - 'home.admin/lnd.install.sh'
# - 'home.admin/cl.install.sh'
# - 'home.admin/cl-plugin.cln-grpc.sh'
# - 'home.admin/tor.install.sh'
# - 'home.admin/blitz.i2pd.sh'
# - 'home.admin/blitz.web.sh'
# - 'home.admin/bonus.nodejs.sh'
# - 'home.admin/bonus.rtl.sh'
# - 'home.admin/bonus.btcpayserver.sh'
# - 'home.admin/bonus.thunderhub.sh'
# - 'home.admin/bonus.jam.sh install'
# - 'home.admin/bonus.mempool.sh'
# - 'home.admin/blitz.web.api.sh'
# - 'home.admin/blitz.web.ui.sh'
# - 'home.admin/blitz.display.sh'
# - 'ci/amd64/**'
jobs:
amd64-image-build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- 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 [ -z "$GITHUB_HEAD_REF" ]; then
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
else
echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
fi
if [[ "${{github.event_name}}" == "pull_request" ]]; then
echo "GITHUB_USER=${{github.event.pull_request.head.repo.owner.login}}" >> $GITHUB_OUTPUT
else
echo "GITHUB_USER=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT
fi
- name: Display the build name
run: echo "Building the raspiblitz-amd64-debian-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}"
- name: Run the build script
run: |
echo "Using the variables: --pack fatpack --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop none"
cd ci/amd64
bash packer.build.amd64-debian.sh --pack fatpack --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop none
- name: Compute checksum of the raw image
run: |
cd ci/amd64/builds/raspiblitz-amd64-debian-fatpack-qemu/
sha256sum raspiblitz-amd64-debian-fatpack.qcow2 > raspiblitz-amd64-debian-fatpack.qcow2.sha256
- name: Compress image
run: |
cd ci/amd64/builds/raspiblitz-amd64-debian-fatpack-qemu/
gzip -v9 raspiblitz-amd64-debian-fatpack.qcow2
- name: Compute checksum of the compressed image
run: |
cd ci/amd64/builds/raspiblitz-amd64-debian-fatpack-qemu/
sha256sum raspiblitz-amd64-debian-fatpack.qcow2.gz > raspiblitz-amd64-debian-fatpack.qcow2.gz.sha256
- name: Upload the image and checksums
uses: actions/upload-artifact@v4
with:
name: raspiblitz-amd64-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}
path: |
${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-fatpack-qemu/raspiblitz-amd64-debian-fatpack.qcow2.sha256
${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-fatpack-qemu/raspiblitz-amd64-debian-fatpack.qcow2.gz
${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-fatpack-qemu/raspiblitz-amd64-debian-fatpack.qcow2.gz.sha256