Skip to content

Merge pull request #141 from bnb-chain/changeset-release/main #63

Merge pull request #141 from bnb-chain/changeset-release/main

Merge pull request #141 from bnb-chain/changeset-release/main #63

Workflow file for this run

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 }}