Skip to content

Commit 3dda7c4

Browse files
Update build.yml
1 parent 8d11b9d commit 3dda7c4

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ on:
77
branches: [ "main" ]
88
workflow_dispatch:
99
schedule:
10-
# Run the workflow on the 1st of every month at midnight
11-
- cron: '0 0 1 * *'
10+
- cron: '0 0 1 * *' # Monthly run
1211

1312
jobs:
1413
build:
15-
runs-on: ubuntu-latest # Use a standard runner
14+
runs-on: ubuntu-latest
1615

1716
steps:
1817
- name: Checkout Repository
@@ -34,46 +33,38 @@ jobs:
3433
- name: Rename ISO to Arch
3534
run: |
3635
docker exec arch-container bash -c "
37-
# Find the created ISO (assuming only one .iso file in the output directory)
3836
iso_file=\$(ls /workdir/out/*.iso | head -n 1) &&
3937
mv \$iso_file /workdir/out/Arch.iso
4038
"
4139
4240
- name: List ISO files
43-
run: |
44-
# List files in the output directory to verify renaming
45-
docker exec arch-container bash -c "ls -l /workdir/out/"
41+
run: docker exec arch-container bash -c "ls -l /workdir/out/"
4642

4743
- name: Copy ISO to Host
48-
run: |
49-
# Copy the renamed ISO to the host
50-
docker cp arch-container:/workdir/out/Arch.iso ${{ github.workspace }}/
44+
run: docker cp arch-container:/workdir/out/Arch.iso ${{ github.workspace }}/
5145

5246
- name: Get current date
5347
id: date
5448
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
5549

56-
# Create a release on GitHub
5750
- name: Create GitHub Release
58-
id: create_release # Store the release details for later steps
59-
uses: actions/create-release@v1
51+
id: create_release
52+
uses: actions/create-release@v1 # Consider updating to v1.1.0 or newer
6053
env:
6154
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6255
with:
63-
tag_name: v${{ github.event.inputs.date || github.run_number }}-release
64-
release_name: Arch Linux ISO Release ${{ github.event.inputs.date || format('for {0}', github.run_number) }}
65-
body: |
66-
This release contains the Arch Linux ISO built on ${{ steps.date.outputs.date }}.
56+
tag_name: "v${{ steps.date.outputs.date }}-release"
57+
release_name: "Arch Linux ISO Release - ${{ steps.date.outputs.date }}"
58+
body: "This release contains the Arch Linux ISO built on ${{ steps.date.outputs.date }}."
6759
draft: false
6860
prerelease: false
6961

70-
# Upload the ISO to the release
7162
- name: Upload ISO to GitHub Release
7263
uses: actions/upload-release-asset@v1
7364
with:
7465
upload_url: ${{ steps.create_release.outputs.upload_url }}
7566
asset_path: ${{ github.workspace }}/Arch.iso
76-
asset_name: Arch-$(date +'%Y-%m-%d').iso
67+
asset_name: Arch-${{ steps.date.outputs.date }}.iso
7768
asset_content_type: application/octet-stream
7869

7970
- name: Clean Up

0 commit comments

Comments
 (0)