Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

Commit 5a5095f

Browse files
Update build.yml
1 parent aa9457b commit 5a5095f

File tree

1 file changed

+43
-7
lines changed

1 file changed

+43
-7
lines changed

.github/workflows/build.yml

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: build
22

33
on:
4-
push:
5-
branches: [ 'main' ]
6-
pull_request:
7-
branches: [ 'main' ]
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
87

98
concurrency:
109
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -25,8 +24,9 @@ jobs:
2524
- android-arm64
2625
name: Build
2726
runs-on: ${{ matrix.platform }}
27+
outputs:
28+
artifacts: ${{ steps.upload.outputs.artifact_paths }}
2829
steps:
29-
3030
- name: Checkout
3131
uses: actions/checkout@v4
3232

@@ -55,7 +55,43 @@ jobs:
5555
github.com/alist-org/alist/v3/internal/conf.WebVersion=dev
5656
5757
- name: Upload artifact
58+
id: upload
5859
uses: actions/upload-artifact@v4
5960
with:
60-
name: openlist_${{ env.SHA }}_${{ matrix.target }}
61-
path: build/*
61+
name: openlist_${{ steps.short-sha.outputs.sha }}_${{ matrix.target }}
62+
path: build/*
63+
64+
release:
65+
name: Create Release
66+
needs: build
67+
runs-on: ubuntu-latest
68+
steps:
69+
- name: Get UTC timestamp
70+
id: time
71+
run: echo "tag=nightly-$(date -u '+%Y%m%d-%H%M')" >> $GITHUB_OUTPUT
72+
73+
- name: Download all artifacts
74+
uses: actions/download-artifact@v4
75+
with:
76+
path: artifacts
77+
78+
- name: Create Release
79+
id: create_release
80+
uses: actions/create-release@v2
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.WF_TOKEN }}
83+
with:
84+
tag_name: ${{ steps.time.outputs.tag }}
85+
release_name: Build @ UTC $(date -u '+%Y-%m-%d %H:%M')
86+
draft: false
87+
prerelease: false
88+
89+
- name: Upload Release Assets
90+
uses: actions/upload-release-asset@v2
91+
env:
92+
GITHUB_TOKEN: ${{ secrets.WF_TOKEN }}
93+
with:
94+
upload_url: ${{ steps.create_release.outputs.upload_url }}
95+
asset_path: ./artifacts/
96+
asset_name: ${{ basename(artifact_path) }}
97+
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)