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
34- echo "WORKSPACE=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
3533
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/*
4234
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 }}-
5035
5136 - name : Set up Arch Linux Container
5237 run : |
@@ -139,47 +124,34 @@ jobs:
139124 # Create a temporary file for release notes
140125 TEMP_RELEASE_NOTES=$(mktemp)
141126
142- docker exec arch-container bash -c "
143- set -euo pipefail
144- cd /workdir
145-
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
160- 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- "
127+ # Generate header for release notes
128+ echo "🚀 Arch Linux ISO without system beeps (build ${{ env.DATE }})" > $TEMP_RELEASE_NOTES
129+ echo "" >> $TEMP_RELEASE_NOTES
130+
131+ # Get release notes from GitHub action
132+ gh api \
133+ -H "Accept: application/vnd.github+json" \
134+ -H "X-GitHub-Api-Version: 2022-11-28" \
135+ /repos/${GITHUB_REPOSITORY}/releases/generate-notes \
136+ -F tag_name="v${{ env.VERSION }}" \
137+ -F target_commitish="${GITHUB_SHA}" \
138+ -F previous_tag_name="$(git describe --tags --abbrev=0 2>/dev/null || echo '')" \
139+ | jq -r '.body' >> $TEMP_RELEASE_NOTES
175140
176- # Copy release notes from container to host
177- docker cp arch-container:/tmp/release_notes $TEMP_RELEASE_NOTES
141+ # Add standard information
142+ {
143+ echo ""
144+ echo "### Download"
145+ echo "- Download the ISO and verify checksums before use"
146+ echo ""
147+ echo "### Checksums"
148+ echo "SHA256 and SHA512 checksums are available in the uploaded files."
149+ } >> $TEMP_RELEASE_NOTES
178150
179151 # Set the release notes in GITHUB_ENV
180- echo ' RELEASE_NOTES<<EOF' >> $GITHUB_ENV
152+ echo " RELEASE_NOTES<<EOF" >> $GITHUB_ENV
181153 cat $TEMP_RELEASE_NOTES >> $GITHUB_ENV
182- echo ' EOF' >> $GITHUB_ENV
154+ echo " EOF" >> $GITHUB_ENV
183155
184156 # Cleanup
185157 rm -f $TEMP_RELEASE_NOTES
@@ -205,14 +177,4 @@ jobs:
205177 docker stop arch-container || true
206178 docker rm -f arch-container || true
207179 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
213- with :
214- name : build-logs
215- path : |
216- ${{ env.WORKSPACE }}/build.log
217- retention-days : 5
218- compression-level : 9 # Maximum compression for logs
180+ sudo rm -rf workdir/ out/*.iso out/*.sha*sum
0 commit comments