Skip to content

Commit

Permalink
chore: update action to trigger builds only if npm package was published
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-polk committed Nov 11, 2024
1 parent aad475b commit 00d4255
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ jobs:
run: npm pkg delete scripts && npm pkg delete devDependencies && npm pkg delete dependencies

- name: Publish package
id: semantic_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release

- name: Set output if new release published to npm
if: success() && steps.semantic_release.outputs.new_release_published == 'true'
run: echo "::set-output name=new_release_published::true"
5 changes: 3 additions & 2 deletions .github/workflows/trigger-teamcity-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ on:
workflows: ["Build-Test-Release"]
types:
- completed
workflow_dispatch: # Allows manual triggering
workflow_dispatch: # Allows manual triggering

jobs:
trigger-teamcity:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
# Either a manual run or the Build-Test-Release workflow has completed successfully and a new release was published to npm
if: ${{ github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.outputs.new_release_published == 'true') }}
steps:
- name: Trigger TeamCity Build for Bloom Reader Alpha
uses: fjogeleit/http-request-action@v1
Expand Down

0 comments on commit 00d4255

Please sign in to comment.