Skip to content

Commit 8d11b9d

Browse files
Refine WF (Workflow)
1 parent c2d4807 commit 8d11b9d

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

.github/workflows/blank.yml renamed to .github/workflows/build.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [ "main" ]
88
workflow_dispatch:
9+
schedule:
10+
# Run the workflow on the 1st of every month at midnight
11+
- cron: '0 0 1 * *'
912

1013
jobs:
1114
build:
@@ -33,7 +36,6 @@ jobs:
3336
docker exec arch-container bash -c "
3437
# Find the created ISO (assuming only one .iso file in the output directory)
3538
iso_file=\$(ls /workdir/out/*.iso | head -n 1) &&
36-
3739
mv \$iso_file /workdir/out/Arch.iso
3840
"
3941
@@ -47,13 +49,32 @@ jobs:
4749
# Copy the renamed ISO to the host
4850
docker cp arch-container:/workdir/out/Arch.iso ${{ github.workspace }}/
4951
50-
- name: Upload Build Artifact
51-
uses: actions/[email protected]
52+
- name: Get current date
53+
id: date
54+
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
55+
56+
# Create a release on GitHub
57+
- name: Create GitHub Release
58+
id: create_release # Store the release details for later steps
59+
uses: actions/create-release@v1
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
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 }}.
67+
draft: false
68+
prerelease: false
69+
70+
# Upload the ISO to the release
71+
- name: Upload ISO to GitHub Release
72+
uses: actions/upload-release-asset@v1
5273
with:
53-
name: Arch Linux
54-
path: "Arch.iso"
55-
retention-days: 90
56-
include-hidden-files: false
74+
upload_url: ${{ steps.create_release.outputs.upload_url }}
75+
asset_path: ${{ github.workspace }}/Arch.iso
76+
asset_name: Arch-$(date +'%Y-%m-%d').iso
77+
asset_content_type: application/octet-stream
5778

5879
- name: Clean Up
5980
run: |

0 commit comments

Comments
 (0)