Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6308167

Browse files
committed
ci(beta): adjust workflows to support beta releases
1 parent dcdc877 commit 6308167

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, beta]
66
pull_request:
7-
branches: [main]
7+
branches: [main, beta]
88

99
jobs:
1010
lint:

.github/workflows/release-beta.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Release Beta
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- CI
7+
branches:
8+
- beta
9+
types:
10+
- completed
11+
12+
jobs:
13+
release_beta:
14+
name: Release Beta
15+
# run only if the CI workflow is successful
16+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: ⬇️ Checkout
20+
uses:
21+
actions/checkout@v3
22+
# make sure to checkout the commit that triggered the CI workflow
23+
# (which is not necessarily the latest commit)
24+
with:
25+
ref: ${{ github.event.workflow_run.head_commit.id }}
26+
27+
- name: ⎔ Setup node
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: "lts/*"
31+
32+
- name: 🏗 Install and Build
33+
run: |
34+
npm ci
35+
npm run build
36+
37+
- name: 🚀 Create/Update Release Pull Request or Publish to npm
38+
id: changesets
39+
uses: changesets/action@v1
40+
with:
41+
version: npm run version
42+
publish: npm run release
43+
title: "chore(new-beta-release)"
44+
commit: "chore(new-beta-release)"
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.STACKS_TOOLING_GH_RW_PAT }}
47+
NPM_TOKEN: ${{ secrets.NPM_API_KEY }}
48+
49+
# cancel the jobs if another workflow is kicked off for the same branch
50+
concurrency:
51+
group: ${{ github.workflow }}-${{ github.ref }}
52+
cancel-in-progress: true

0 commit comments

Comments
 (0)