chore: release main (#23) #42
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 | |
packages: write | |
name: Run Release Please | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: google-github-actions/release-please-action@v4 | |
id: release | |
with: | |
token: ${{secrets.GITHUB_TOKEN}} | |
default-branch: main | |
# The logic below handles the npm publication: | |
- name: Checkout Repository | |
if: ${{ steps.release.outputs.releases_created }} | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
if: ${{ steps.release.outputs.releases_created }} | |
with: | |
node-version: latest | |
cache: npm | |
registry-url: 'https://npm.pkg.github.com' | |
- name: Build Packages | |
if: ${{ steps.release.outputs.releases_created }} | |
run: | | |
npm ci | |
npm run build:all | |
# 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: ${{ steps.release.outputs.releases_created }} | |
env: | |
NODE_AUTH_TOKEN: ${{ github.token }} | |
run: npx lerna publish from-package --no-push --no-private --no-verify-access --yes |