@@ -107,93 +107,6 @@ The GitHub Actions workflow automatically builds and releases the ISO. Here’s
107107 You can run the workflow manually by going to ** Actions > Build ISO** and clicking on ** Run Workflow** .
108108
109109
110- ### GitHub Actions Workflow Example
111-
112- Here's the full GitHub Actions workflow used for automated builds and releases:
113-
114- ``` yaml
115- name : Build ISO
116-
117- on :
118- workflow_dispatch :
119- schedule :
120- # Run the workflow every day at midnight
121- - cron : 0 0 * * *
122-
123- jobs :
124- build :
125- runs-on : ubuntu-latest # Use a standard runner
126-
127- steps :
128- - name : Checkout Repository
129- uses : actions/checkout@v4
130-
131- - name : Set up Arch Linux Container
132- run : |
133- docker run --privileged --name arch-container -d -v ${{ github.workspace }}:/workdir archlinux:latest sleep infinity
134-
135- - name : Build ISO in Arch Container
136- run : |
137- docker exec arch-container bash -c "
138- pacman -Syu --noconfirm &&
139- pacman -S --noconfirm git archiso grub &&
140- cd /workdir &&
141- mkarchiso -v -w workdir/ -o out/ .
142- "
143-
144- - name : Rename ISO to Arch.iso
145- run : |
146- docker exec arch-container bash -c "
147- # Find the created ISO (assuming only one .iso file in the output directory)
148- iso_file=\$(ls /workdir/out/*.iso | head -n 1) &&
149- mv \$iso_file /workdir/out/Arch.iso
150- "
151-
152- - name : List ISO files
153- run : |
154- # List files in the output directory to verify renaming
155- docker exec arch-container bash -c "ls -l /workdir/out/"
156-
157- - name : Copy ISO to Host
158- run : |
159- # Copy the renamed ISO to the host
160- docker cp arch-container:/workdir/out/Arch.iso ${{ github.workspace }}/
161-
162- - name : Get current date
163- id : date
164- run : echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
165-
166- # Create a release on GitHub using Personal Access Token (PAT)
167- - name : Create GitHub Release
168- id : create_release # Adding an ID to reference the release step
169- 170- env :
171- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
172- with :
173- tag_name : v${{ github.run_id }}-release
174- release_name : " Arch Linux Release"
175- body : |
176- This release contains the Arch Linux ISO built on ${{ steps.date.outputs.date }}.
177- draft : false
178- prerelease : false
179-
180- # Upload the ISO to the GitHub release with a specific, predictable name
181- - name : Upload ISO to GitHub Release
182- uses : actions/upload-release-asset@v1
183- env :
184- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
185- with :
186- upload_url : ${{ steps.create_release.outputs.upload_url }}
187- asset_path : ${{ github.workspace }}/Arch.iso
188- asset_name : Arch.iso
189- asset_content_type : application/octet-stream
190-
191- - name : Clean Up
192- run : |
193- docker stop arch-container
194- docker rm arch-container
195- ` ` `
196-
197110---
198111
199112## License
0 commit comments