44 workflow_dispatch :
55 schedule :
66 - cron : ' 0 0 * * *' # Run the workflow every day at midnight
7+ push :
8+ branches :
9+ - main
10+ - dev
11+ paths-ignore :
12+ - ' **.md'
13+ - ' .gitignore'
14+
15+ env :
16+ DOCKER_BUILDKIT : 1
17+ ISO_FILENAME : Arch.iso
718
819jobs :
920 build :
10- runs-on : ubuntu-latest # Use a standard runner
21+ runs-on : ubuntu-latest
22+ timeout-minutes : 120 # Set a timeout to prevent hung builds
1123
1224 steps :
1325 - name : Checkout Repository
1426 uses : actions/checkout@v4
1527
28+ - name : Set up Docker Buildx
29+ uses : docker/setup-buildx-action@v3
30+ with :
31+ buildkitd-flags : --debug
32+
33+ - name : Cache Docker layers
34+ uses : actions/cache@v3
35+ with :
36+ path : /tmp/.buildx-cache
37+ key : ${{ runner.os }}-buildx-${{ github.sha }}
38+ restore-keys : |
39+ ${{ runner.os }}-buildx-
40+
41+ - name : Set up environment variables
42+ id : env
43+ run : |
44+ echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
45+ echo "VERSION=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
46+ echo "CACHE_KEY=$(date +'%Y-%m')" >> $GITHUB_ENV
47+
48+ - name : Cache Pacman packages
49+ uses : actions/cache@v3
50+ with :
51+ path : /tmp/pacman-cache
52+ key : pacman-${{ env.CACHE_KEY }}
53+ restore-keys : |
54+ pacman-
55+
1656 - name : Set up Arch Linux Container
1757 run : |
18- docker run --privileged --name arch-container -d -v ${{ github.workspace }}:/workdir archlinux:latest sleep infinity
58+ mkdir -p /tmp/pacman-cache
59+ docker run --privileged --name arch-container -d \
60+ -v ${{ github.workspace }}:/workdir \
61+ -v /tmp/pacman-cache:/var/cache/pacman/pkg \
62+ archlinux:latest sleep infinity
1963
20- - name : Build ISO in Arch Container
64+ - name : Update and Install Dependencies
2165 run : |
22- set -e
2366 docker exec arch-container bash -c "
24- pacman -Syu --noconfirm &&
25- pacman -S --noconfirm git archiso grub &&
26- cd /workdir &&
27- mkarchiso -v -w workdir/ -o out/ .
67+ set -euo pipefail
68+ pacman -Sy --noconfirm
69+ pacman -S --noconfirm --needed git archiso grub curl jq gnupg
2870 "
2971
30- - name : Rename ISO to Arch.iso
72+ - name : Build ISO
73+ id : build
3174 run : |
32- set -e
3375 docker exec arch-container bash -c "
34- iso_file=\$(ls /workdir/out/*.iso 2>/dev/null | head -n 1) &&
35- [ -n \"\$iso_file\" ] && mv \$iso_file /workdir/out/Arch.iso || echo 'No ISO file found.'
76+ set -euo pipefail
77+ cd /workdir
78+ # Cleanup any previous builds
79+ rm -rf workdir/ out/
80+ # Build the ISO with verbose output
81+ mkarchiso -v -w workdir/ -o out/ . || {
82+ echo 'ISO build failed!'
83+ exit 1
84+ }
3685 "
3786
38- - name : List ISO files
87+ - name : Generate Checksums
3988 run : |
40- docker exec arch-container bash -c "ls -l /workdir/out/" || echo 'Failed to list files.'
89+ docker exec arch-container bash -c "
90+ cd /workdir/out
91+ sha256sum *.iso > sha256sums.txt
92+ sha512sum *.iso > sha512sums.txt
93+ "
4194
42- - name : Copy ISO to Host
95+ - name : Rename and Move ISO
4396 run : |
44- docker cp arch-container:/workdir/out/Arch.iso ${{ github.workspace }}/ || echo 'Failed to copy ISO to host.'
97+ docker exec arch-container bash -c "
98+ cd /workdir/out
99+ for f in *.iso; do
100+ mv \"\$f\" \"arch-linux-no-beeps-${{ env.VERSION }}.iso\"
101+ done
102+ "
45103
46104 - name : Upload ISO Artifact
47105 uses : actions/upload-artifact@v3
48106 with :
49- name : Arch.iso
50- path : ${{ github.workspace }}/Arch.iso
51-
52- - name : Get current date
53- id : date
54- run : echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
55-
56- # Create a release on GitHub using GITHUB_TOKEN
57- - name : Create GitHub Release
58- id : create_release # Adding an ID to reference the release step
59- 60- env :
61- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
107+ name : arch-linux-no-beeps-${{ env.VERSION }}
108+ path : |
109+ ${{ github.workspace }}/out/*.iso
110+ ${{ github.workspace }}/out/sha*sums.txt
111+ retention-days : 5
112+
113+ - name : Create Release
114+ id : create_release
115+ uses : softprops/action-gh-release@v1
116+ if : github.ref == 'refs/heads/main'
62117 with :
63- tag_name : " v${{ github.run_id }}-release "
64- release_name : " Arch Linux Release "
118+ tag_name : v${{ env.VERSION }}
119+ name : " Arch Linux No Beeps v${{ env.VERSION }} "
65120 body : |
66- This release contains the Arch Linux ISO built on ${{ steps.date.outputs.DATE }}.
121+ 🚀 Arch Linux ISO without system beeps (build ${{ env.DATE }})
122+
123+ ### Changes
124+ - Automatic daily build
125+ - System beeps disabled
126+ - ISO SHA256 and SHA512 checksums added
127+
128+ ### Download
129+ - Download the ISO and verify checksums before use
130+
131+ ### Checksums
132+ SHA256 and SHA512 checksums are available in the uploaded files.
67133 draft : false
68134 prerelease : false
69-
70- # Upload the ISO to the GitHub release with a specific, predictable name
71- - name : Upload ISO to GitHub Release
72- uses : actions/upload-release-asset@v1
73- env :
74- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
75- with :
76- upload_url : ${{ steps.create_release.outputs.upload_url }}
77- asset_path : ${{ github.workspace }}/Arch.iso
78- asset_name : Arch.iso
79- asset_content_type : application/octet-stream
135+ files : |
136+ ${{ github.workspace }}/out/*.iso
137+ ${{ github.workspace }}/out/sha*sums.txt
80138
81139 - name : Clean Up
140+ if : always()
141+ run : |
142+ docker stop arch-container || true
143+ docker rm arch-container || true
144+ rm -rf workdir/ out/
145+
146+ - name : Notify on Failure
147+ if : failure()
82148 run : |
83- docker stop arch-container || echo 'Failed to stop the container.'
84- docker rm arch-container || echo 'Failed to remove the container.'
149+ echo "::error::ISO build failed! Check the logs for more details."
0 commit comments