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
3334 echo "WORKSPACE=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
3435
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+
3551 - name : Set up Arch Linux Container
3652 run : |
3753 docker run --privileged --name arch-container -d \
@@ -117,81 +133,86 @@ jobs:
117133 done
118134 "
119135
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-
139136 - name : Generate Release Notes
140137 id : release_notes
141138 run : |
142139 # Create a temporary file for release notes
143140 TEMP_RELEASE_NOTES=$(mktemp)
144141
145- {
146- echo "π Arch Linux ISO without system beeps (build ${{ env.DATE }})"
147- echo ""
148- echo "### Changes"
142+ docker exec arch-container bash -c "
143+ set -euo pipefail
144+ cd /workdir
149145
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 ""
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
157160 fi
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
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
166178
167- echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
179+ # Set the release notes in GITHUB_ENV
180+ echo 'RELEASE_NOTES<<EOF' >> $GITHUB_ENV
168181 cat $TEMP_RELEASE_NOTES >> $GITHUB_ENV
169- echo " EOF" >> $GITHUB_ENV
182+ echo ' EOF' >> $GITHUB_ENV
170183
184+ # Cleanup
171185 rm -f $TEMP_RELEASE_NOTES
172186
173187 - name : Create Release
188+ id : create_release
174189 uses : softprops/action-gh-release@v2
190+ if : github.ref == 'refs/heads/main'
175191 with :
176192 tag_name : v${{ env.VERSION }}
177- name : " Arch Linux without the beeps v${{ env.VERSION }}"
193+ name : " Arch Linux No Beeps v${{ env.VERSION }}"
178194 body : ${{ env.RELEASE_NOTES }}
179195 draft : false
180196 prerelease : false
181197 files : |
182198 ${{ env.WORKSPACE }}/out/*.iso
183199 ${{ env.WORKSPACE }}/out/*.sha*sum
184200
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
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
192213 with :
193214 name : build-logs
194215 path : |
195216 ${{ env.WORKSPACE }}/build.log
196217 retention-days : 5
197- compression-level : 9
218+ compression-level : 9 # Maximum compression for logs
0 commit comments