Merge pull request #45 from case-contract-testing/dependabot/npm_and_… #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
name: Run Release Please | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 | |
with: | |
egress-policy: audit | |
- uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4.1.3 | |
id: release | |
with: | |
token: ${{ secrets.RATE_TOKEN_GH }} | |
outputs: | |
release_created: ${{ steps.release.outputs.release_created }} | |
tag_name: ${{ steps.release.outputs.tag_name }} | |
publish: | |
needs: [release-please] | |
runs-on: ubuntu-latest | |
steps: | |
# The logic below handles the npm publication: | |
- name: Harden Runner | |
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 | |
with: | |
egress-policy: audit | |
- name: Checkout Repository | |
if: ${{ needs.release-please.outputs.release_created }} | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Setup Node | |
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 | |
if: ${{ needs.release-please.outputs.release_created }} | |
with: | |
node-version: 18 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Build Packages | |
if: ${{ needs.release-please.outputs.release_created }} | |
run: ci/build-and-test.sh | |
env: | |
NODE_VERSION: 18 | |
FORCE_COLOR: true | |
# Release Please has already incremented versions and published tags, so we just | |
# need to publish all unpublished versions to NPM here | |
# See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package | |
# - name: Publish to NPM | |
# if: ${{ needs.release-please.outputs.release_created }} | |
# env: | |
# NODE_AUTH_TOKEN: ${{secrets.CONTRACT_CASE_NPM}} | |
# run: npx lerna publish from-package --no-push --no-private --yes |