Skip to content

Commit 86f743a

Browse files
Merge branch 'main' into Enhance-WF
2 parents 00b7c53 + 6096c1d commit 86f743a

File tree

2 files changed

+39
-4
lines changed

2 files changed

+39
-4
lines changed

.github/workflows/build-check.yaml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,28 @@ jobs:
2828
pacman -Syu --noconfirm
2929
pacman -S --noconfirm git archiso grub
3030
mkarchiso -v -w workdir/ -o out/ .
31+
"
3132
32-
- name: Upload ISO Artifact
33-
uses: actions/upload-artifact@v3
33+
- name: Rename ISO to Arch.iso
34+
run: |
35+
docker exec arch-container bash -c "
36+
iso_file=\$(ls /workdir/out/*.iso 2>/dev/null | head -n 1) &&
37+
[ -n \"\$iso_file\" ] && mv \$iso_file /workdir/out/Arch.iso || echo 'No ISO file found.'
38+
"
39+
40+
- name: Copy ISO to Host
41+
run: |
42+
docker cp arch-container:/workdir/out/Arch.iso ${{ github.workspace }}/ || echo 'Failed to copy ISO to host.'
43+
44+
- name: Get current date
45+
id: date
46+
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
47+
48+
- name: Create GitHub Release
49+
id: create_release
50+
uses: actions/[email protected]
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3453
with:
3554
name: Arch.iso
3655
path: out/Arch.iso

.github/workflows/build.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
2929
- name: Get current date
3030
id: date
31-
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
31+
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
3232

3333
- name: Create GitHub Release
3434
uses: ncipollo/release-action@v1
@@ -40,4 +40,20 @@ jobs:
4040
This release contains the Arch Linux ISO built on ${{ steps.date.outputs.date }}.
4141
artifacts: out/Arch.iso
4242
draft: false
43-
prerelease: false
43+
prerelease: false
44+
45+
# Upload the ISO to the GitHub release with a specific, predictable name
46+
- name: Upload ISO to GitHub Release
47+
uses: actions/upload-release-asset@v1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
upload_url: ${{ steps.create_release.outputs.upload_url }}
52+
asset_path: ${{ github.workspace }}/Arch.iso
53+
asset_name: Arch.iso
54+
asset_content_type: application/octet-stream
55+
56+
- name: Clean Up
57+
run: |
58+
docker stop arch-container || echo 'Failed to stop the container.'
59+
docker rm arch-container || echo 'Failed to remove the container.'

0 commit comments

Comments
 (0)