3030 run : |
3131 echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
3232 echo "VERSION=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
33- echo "CACHE_KEY=$(date +'%Y-%m')" >> $GITHUB_ENV
3433 echo "WORKSPACE=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
3534
36- - name : Create Cache Directories
37- run : |
38- sudo mkdir -p /tmp/pacman-cache
39- sudo chmod 777 /tmp/pacman-cache
40- # Ensure the directory is empty to prevent tar errors
41- sudo rm -rf /tmp/pacman-cache/*
42-
43- - name : Cache Pacman packages
44- uses : actions/cache@v4
45- with :
46- path : /tmp/pacman-cache
47- key : pacman-${{ runner.os }}-${{ env.CACHE_KEY }}
48- restore-keys : |
49- pacman-${{ runner.os }}-
50-
5135 - name : Set up Arch Linux Container
5236 run : |
5337 docker run --privileged --name arch-container -d \
@@ -133,86 +117,81 @@ jobs:
133117 done
134118 "
135119
120+ - name : Clean Up
121+ if : always()
122+ run : |
123+ if docker ps -a | grep -q arch-container; then
124+ docker stop arch-container || true
125+ docker rm -f arch-container || true
126+ fi
127+ sudo rm -rf workdir/ out/ /tmp/pacman-cache/*
128+
129+ create-release :
130+ needs : build
131+ if : github.ref == 'refs/heads/main'
132+ runs-on : ubuntu-latest
133+ steps :
134+ - name : Checkout Repository
135+ uses : actions/checkout@v4
136+ with :
137+ fetch-depth : 0 # Nodig voor git history
138+
136139 - name : Generate Release Notes
137140 id : release_notes
138141 run : |
139142 # Create a temporary file for release notes
140143 TEMP_RELEASE_NOTES=$(mktemp)
141144
142- docker exec arch-container bash -c "
143- set -euo pipefail
144- cd /workdir
145+ {
146+ echo "🚀 Arch Linux ISO without system beeps (build ${{ env.DATE }})"
147+ echo ""
148+ echo "### Changes"
145149
146- # Initialize release notes
147- {
148- echo '🚀 Arch Linux ISO without system beeps (build ${{ env.DATE }})'
149- echo ''
150- echo '### Changes'
151-
152- # Get changes since last release
153- if git tag | grep -q .; then
154- LAST_TAG=\$(git describe --tags --abbrev=0 2>/dev/null || echo '')
155- if [ ! -z \"\$LAST_TAG\" ]; then
156- echo '#### Commits since last release:'
157- git log \"\$LAST_TAG\"..HEAD --pretty=format:'- %s' | grep -v 'Merge'
158- echo ''
159- fi
150+ # Get changes since last release
151+ if git tag | grep -q .; then
152+ LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo '')
153+ if [ ! -z "$LAST_TAG" ]; then
154+ echo "#### Commits since last release:"
155+ git log "$LAST_TAG"..HEAD --pretty=format:'- %s' | grep -v 'Merge'
156+ echo ""
160157 fi
161-
162- # Add standard information
163- echo '### Features'
164- echo '- Automatic daily build'
165- echo '- System beeps disabled'
166- echo '- ISO SHA256 and SHA512 checksums included'
167- echo ''
168- echo '### Download'
169- echo '- Download the ISO and verify checksums before use'
170- echo ''
171- echo '### Checksums'
172- echo 'SHA256 and SHA512 checksums are available in the uploaded files.'
173- } > /tmp/release_notes
174- "
175-
176- # Copy release notes from container to host
177- docker cp arch-container:/tmp/release_notes $TEMP_RELEASE_NOTES
158+ fi
159+
160+ echo "### Download"
161+ echo "- Download the ISO and verify checksums before use"
162+ echo ""
163+ echo "### Checksums"
164+ echo "SHA256 and SHA512 checksums are available in the uploaded files."
165+ } > $TEMP_RELEASE_NOTES
178166
179- # Set the release notes in GITHUB_ENV
180- echo 'RELEASE_NOTES<<EOF' >> $GITHUB_ENV
167+ echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
181168 cat $TEMP_RELEASE_NOTES >> $GITHUB_ENV
182- echo ' EOF' >> $GITHUB_ENV
169+ echo " EOF" >> $GITHUB_ENV
183170
184- # Cleanup
185171 rm -f $TEMP_RELEASE_NOTES
186172
187173 - name : Create Release
188- id : create_release
189174 uses : softprops/action-gh-release@v2
190- if : github.ref == 'refs/heads/main'
191175 with :
192176 tag_name : v${{ env.VERSION }}
193- name : " Arch Linux No Beeps v${{ env.VERSION }}"
177+ name : " Arch Linux without the beeps v${{ env.VERSION }}"
194178 body : ${{ env.RELEASE_NOTES }}
195179 draft : false
196180 prerelease : false
197181 files : |
198182 ${{ env.WORKSPACE }}/out/*.iso
199183 ${{ env.WORKSPACE }}/out/*.sha*sum
200184
201- - name : Clean Up
202- if : always()
203- run : |
204- if docker ps -a | grep -q arch-container; then
205- docker stop arch-container || true
206- docker rm -f arch-container || true
207- fi
208- sudo rm -rf workdir/ out/ /tmp/pacman-cache/*
209-
210- - name : Upload Build Logs on Failure
211- if : failure()
212- uses : actions/upload-artifact@v4 # Upgrade to v4
185+ upload-logs :
186+ needs : build
187+ if : failure()
188+ runs-on : ubuntu-latest
189+ steps :
190+ - name : Upload Build Logs
191+ uses : actions/upload-artifact@v4
213192 with :
214193 name : build-logs
215194 path : |
216195 ${{ env.WORKSPACE }}/build.log
217196 retention-days : 5
218- compression-level : 9 # Maximum compression for logs
197+ compression-level : 9
0 commit comments