feat: Publish npm version #30
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 | |
on: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- main | |
paths: | |
- .release/** | |
- packages/canonical-bridge-sdk/** | |
- packages/canonical-bridge-widget/** | |
jobs: | |
pre-check: | |
runs-on: ubuntu-latest | |
if: github.repository == 'bnb-chain/canonical-bridge' | |
outputs: | |
codeowners: ${{ steps.codeowners.outputs.content }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Read codeowners | |
id: codeowners | |
uses: juliangruber/read-file-action@v1 | |
with: | |
path: .github/CODEOWNERS | |
cicd: | |
needs: [pre-check] | |
if: contains(needs.pre-check.outputs.codeowners, github.event.pull_request.user.login) | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code repository | |
uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup | |
with: | |
npm-token: ${{ secrets.NPM_TOKEN }} | |
- name: Install & build | |
shell: bash | |
run: | | |
node .release/scripts/install.js | |
node common/scripts/install-run-rush.js install -t @bnb-chain/canonical-bridge-sdk | |
node common/scripts/install-run-rush.js build -t @bnb-chain/canonical-bridge-sdk | |
node common/scripts/install-run-rush.js install -t @bnb-chain/canonical-bridge-widget | |
node common/scripts/install-run-rush.js build -t @bnb-chain/canonical-bridge-widget | |
- name: Create and publish versions | |
uses: changesets/action@v1 | |
with: | |
version: pnpm ci:stable-version | |
publish: pnpm ci:publish | |
commit: 'chore: Update versions' | |
title: 'chore: Update versions' | |
cwd: '.release' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |