Skip to content

Commit

Permalink
Refactor: Update nightly release workflow to use outputs
Browse files Browse the repository at this point in the history
This commit refactors the nightly release workflow to use outputs to determine if subsequent jobs should run, instead of relying on environment variables.

- The `checkNightly` job now has an output called `shouldRun` that indicates if there are new commits.
- Subsequent jobs now utilize `needs.checkNightly.outputs.shouldRun` instead of `env.NEW_COMMIT_COUNT` to determine their execution condition.
  • Loading branch information
jacobrein committed Dec 27, 2024
1 parent 30c22d4 commit 2d3c47d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/nightly_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
checkNightly:
name: Check for new commits
runs-on: ubuntu-latest
outputs:
shouldRun: ${{ env.NEW_COMMIT_COUNT > 0 }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -22,32 +24,32 @@ jobs:
mangaworld:
needs: checkNightly
if: ${{ env.NEW_COMMIT_COUNT > 0 }}
if: ${{ needs.checkNightly.outputs.shouldRun == 'true' }}
uses: ./.github/workflows/mangaworld_build.yaml
secrets: inherit # pass all secrets

animeworld:
needs: checkNightly
if: ${{ env.NEW_COMMIT_COUNT > 0 }}
if: ${{ needs.checkNightly.outputs.shouldRun == 'true' }}
uses: ./.github/workflows/animeworld_build.yaml
secrets: inherit # pass all secrets

animeworldtv:
needs: checkNightly
if: ${{ env.NEW_COMMIT_COUNT > 0 }}
if: ${{ needs.checkNightly.outputs.shouldRun == 'true' }}
uses: ./.github/workflows/animeworldtv_build.yaml
secrets: inherit # pass all secrets

novelworld:
needs: checkNightly
if: ${{ env.NEW_COMMIT_COUNT > 0 }}
if: ${{ needs.checkNightly.outputs.shouldRun == 'true' }}
uses: ./.github/workflows/novelworld_build.yaml
secrets: inherit # pass all secrets

release:
name: Release APK
needs: [ mangaworld, animeworld, novelworld, animeworldtv ]
if: ${{ env.NEW_COMMIT_COUNT > 0 }}
if: ${{ needs.checkNightly.outputs.shouldRun == 'true' }}
runs-on: ubuntu-latest
steps:

Expand Down

0 comments on commit 2d3c47d

Please sign in to comment.