Merge pull request #191 from bnb-chain/changeset-release/main #82
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: | |
push: | |
branches: | |
- main | |
- alpha | |
paths: | |
- .release/** | |
- packages/canonical-bridge-sdk/** | |
- packages/canonical-bridge-widget/** | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
jobs: | |
cicd: | |
if: github.repository == 'bnb-chain/canonical-bridge' | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code repository | |
uses: actions/checkout@v4 | |
- name: Get branch name | |
id: get-branch | |
run: | | |
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | |
- uses: ./.github/actions/setup | |
with: | |
npm-token: ${{ secrets.NPM_TOKEN }} | |
- name: Install & build | |
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: Enter pre mode | |
if: ${{steps.get-branch.outputs.branch == 'alpha'}} | |
run: cd .release && pnpm ci:enter | |
- name: Create and publish alpha versions | |
if: ${{steps.get-branch.outputs.branch == 'alpha'}} | |
uses: changesets/action@v1 | |
with: | |
version: pnpm ci:alpha-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 }} | |
- name: Exit pre mode | |
if: ${{steps.get-branch.outputs.branch == 'main'}} | |
run: cd .release && pnpm ci:exit | |
- name: Create and publish versions | |
if: ${{steps.get-branch.outputs.branch == 'main'}} | |
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 }} |