|
7 | 7 |
|
8 | 8 | jobs: |
9 | 9 | build: |
10 | | - runs-on: ubuntu-latest # Use a standard runner |
| 10 | + runs-on: ubuntu-latest |
11 | 11 |
|
12 | 12 | steps: |
13 | | - - name: Checkout Repository |
14 | | - uses: actions/checkout@v4 |
15 | | - |
16 | | - - name: Set up Arch Linux Container |
17 | | - run: | |
18 | | - docker run --privileged --name arch-container -d -v ${{ github.workspace }}:/workdir archlinux:latest sleep infinity |
19 | | -
|
20 | | - - name: Build ISO in Arch Container |
21 | | - run: | |
22 | | - set -e |
23 | | - docker exec arch-container bash -c " |
24 | | - pacman -Syu --noconfirm && |
25 | | - pacman -S --noconfirm git archiso grub && |
26 | | - cd /workdir && |
27 | | - mkarchiso -v -w workdir/ -o out/ . |
28 | | - " |
29 | | -
|
30 | | - - name: Rename ISO to Arch.iso |
31 | | - run: | |
32 | | - set -e |
33 | | - docker exec arch-container bash -c " |
34 | | - iso_file=\$(ls /workdir/out/*.iso 2>/dev/null | head -n 1) && |
35 | | - [ -n \"\$iso_file\" ] && mv \$iso_file /workdir/out/Arch.iso || echo 'No ISO file found.' |
36 | | - " |
37 | | -
|
38 | | - - name: List ISO files |
39 | | - run: | |
40 | | - docker exec arch-container bash -c "ls -l /workdir/out/" || echo 'Failed to list files.' |
41 | | -
|
42 | | - - name: Copy ISO to Host |
| 13 | + - name: Checkout code |
| 14 | + uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Build ISO in Arch Linux container |
| 17 | + uses: addnab/docker-run-action@v3 |
| 18 | + with: |
| 19 | + image: archlinux:latest |
| 20 | + options: --privileged |
43 | 21 | run: | |
44 | | - docker cp arch-container:/workdir/out/Arch.iso ${{ github.workspace }}/ || echo 'Failed to copy ISO to host.' |
| 22 | + pacman -Syu --noconfirm |
| 23 | + pacman -S --noconfirm git archiso grub |
| 24 | + mkarchiso -v -w workdir/ -o out/ . |
| 25 | + mv out/*.iso out/Arch.iso |
45 | 26 |
|
46 | 27 | - name: Get current date |
47 | | - id: date |
48 | | - run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT |
| 28 | + id: date |
| 29 | + run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT |
49 | 30 |
|
50 | | - # Create a release on GitHub using GITHUB_TOKEN |
51 | 31 | - name: Create GitHub Release |
52 | | - id: create_release # Adding an ID to reference the release step |
53 | | - |
54 | | - env: |
55 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
56 | | - with: |
57 | | - tag_name: v${{ github.run_id }}-release |
58 | | - release_name: "Arch Linux Release" |
59 | | - body: | |
60 | | - This release contains the Arch Linux ISO built on ${{ steps.date.outputs.date }}. |
61 | | - draft: false |
62 | | - prerelease: false |
63 | | - |
64 | | - # Upload the ISO to the GitHub release with a specific, predictable name |
65 | | - - name: Upload ISO to GitHub Release |
66 | | - uses: actions/upload-release-asset@v1 |
67 | | - env: |
68 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
69 | | - with: |
70 | | - upload_url: ${{ steps.create_release.outputs.upload_url }} |
71 | | - asset_path: ${{ github.workspace }}/Arch.iso |
72 | | - asset_name: Arch.iso |
73 | | - asset_content_type: application/octet-stream |
74 | | - |
75 | | - - name: Clean Up |
76 | | - run: | |
77 | | - docker stop arch-container || echo 'Failed to stop the container.' |
78 | | - docker rm arch-container || echo 'Failed to remove the container.' |
| 32 | + uses: softprops/action-gh-release@v1 |
| 33 | + with: |
| 34 | + files: out/Arch.iso |
| 35 | + tag_name: v${{ github.run_id }}-release |
| 36 | + release_name: "Arch Linux Release" |
| 37 | + body: | |
| 38 | + This release contains the Arch Linux ISO built on ${{ steps.date.outputs.date }}. |
| 39 | + token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments