Skip to content

Commit

Permalink
ci: exit release-please if no release publish needed (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
patricebender authored Dec 5, 2023
1 parent 732c703 commit 12eaae7
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,38 @@ jobs:
token: ${{secrets.CDS_DBS_TOKEN}}
command: manifest
monorepo-tags: true
- name: Only run subsquent steps if a release needs to be published
run: |
if ["${{ steps.release.outputs.releases_created }}"]; then
echo "OK proceeding to release"
else
echo "No release needs to be published, exiting…"
return
fi
# The logic below handles the npm publication:
- uses: actions/checkout@v2
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.releases_created }}
- uses: actions/setup-node@v1
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.releases_created }}

# Publish packages
- run: npm ci
if: ${{ steps.release.outputs.releases_created }}
- run: npm test -w db-service -w sqlite -w postgres -- --maxWorkers=1
if: ${{ steps.release.outputs.releases_created }}
- name: Publish db-service
if: ${{ steps.release.outputs.releases_created && steps.release.outputs.db-service--release_created }}
if: ${{ steps.release.outputs.db-service--release_created }}
run: npm publish --workspace db-service --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

- name: Publish sqlite
if: ${{ steps.release.outputs.releases_created && steps.release.outputs.sqlite--release_created }}
if: ${{ steps.release.outputs.sqlite--release_created }}
run: npm publish --workspace sqlite --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

- name: Publish postgres
if: ${{ steps.release.outputs.releases_created && steps.release.outputs.postgres--release_created }}
if: ${{ steps.release.outputs.postgres--release_created }}
run: npm publish --workspace postgres --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 comments on commit 12eaae7

Please sign in to comment.