mirror of
https://github.com/AIsouler/GKD_subscription.git
synced 2025-12-17 23:34:57 +08:00
chore: auto build release every 3 days at 3 am
This commit is contained in:
28
.github/workflows/build_release.yml
vendored
28
.github/workflows/build_release.yml
vendored
@@ -1,6 +1,9 @@
|
|||||||
name: build_release
|
name: build_release
|
||||||
|
|
||||||
on: workflow_dispatch
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 19 */3 * *'
|
||||||
|
workflow_dispatch
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_release:
|
build_release:
|
||||||
@@ -12,6 +15,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Check for changes in src directory
|
||||||
|
id: changes
|
||||||
|
run: |
|
||||||
|
git diff --exit-code src || echo "Changes detected in 'src' directory."
|
||||||
|
|
||||||
|
- name: Terminate if no changes detected
|
||||||
|
if: steps.changes.outcome != 'success'
|
||||||
|
run: |
|
||||||
|
echo "No changes in 'src' directory, terminating the workflow."
|
||||||
|
exit 1
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
@@ -59,18 +73,6 @@ jobs:
|
|||||||
release_name: Release ${{ steps.version.outputs.version }}
|
release_name: Release ${{ steps.version.outputs.version }}
|
||||||
body_path: ./dist/CHANGELOG.md
|
body_path: ./dist/CHANGELOG.md
|
||||||
|
|
||||||
- name: Upload Release Asset
|
|
||||||
id: upload-release-asset
|
|
||||||
if: ${{ steps.create_release.outcome == 'success' }}
|
|
||||||
uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: ./dist/AIsouler_gkd.json5
|
|
||||||
asset_name: AIsouler_gkd_${{ steps.version.outputs.version }}.json5
|
|
||||||
asset_content_type: application/json
|
|
||||||
|
|
||||||
- name: Publish package
|
- name: Publish package
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user