chore: release main (#623) #548
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
name: Release and Publish Packages | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: write | |
packages: write | |
pull-requests: write | |
jobs: | |
release-and-publish-packages: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: google-github-actions/release-please-action@v3 | |
with: | |
release-type: node | |
command: manifest | |
monorepo-tags: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
id: release | |
- name: Checkout Repository | |
if: ${{ steps.release.outputs.releases_created }} | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Cache node modules | |
if: ${{ steps.release.outputs.releases_created }} | |
id: cache-npm | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: List the state of node modules | |
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} && ${{ steps.release.outputs.releases_created }} | |
continue-on-error: true | |
run: npm list | |
- name: Setup Node | |
if: ${{ steps.release.outputs.releases_created }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: 'https://npm.pkg.github.com' | |
scope: '@juntossomosmais' | |
- name: Authenticate with the GitHub Package Registry | |
if: ${{ steps.release.outputs.releases_created }} | |
run: | | |
echo "@juntossomosmais:registry=https://npm.pkg.github.com" >> .npmrc | |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_ACTIONS }}" >> .npmrc | |
- name: Install dependencies | |
if: ${{ steps.release.outputs.releases_created }} | |
run: npm ci --legacy-peer-deps | |
- name: Build and publish Core | |
if: ${{ steps.release.outputs['packages/core--release_created'] }} | |
run: npx nx run @juntossomosmais/atomium:publish-library | |
continue-on-error: false | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and publish Tokens | |
if: ${{ steps.release.outputs['packages/tokens--release_created'] }} | |
run: npx nx run @juntossomosmais/atomium-tokens:publish-library | |
continue-on-error: false | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |