-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (66 loc) · 2.3 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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 }}