diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 3a843138..55fb7319 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -1,6 +1,9 @@ name: build_release -on: workflow_dispatch +on: + schedule: + - cron: '0 19 */3 * *' + workflow_dispatch jobs: build_release: @@ -12,6 +15,17 @@ jobs: with: 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 with: node-version: 22 @@ -59,18 +73,6 @@ jobs: release_name: Release ${{ steps.version.outputs.version }} 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 env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }}