Skip to content

Commit 97a7aa7

Browse files
committed
ci: publish upon release
1 parent 8d212c3 commit 97a7aa7

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repo
16+
uses: actions/checkout@v3
17+
18+
- name: Setup Node.js 20.x
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 20.x
22+
23+
- name: Install Dependencies
24+
run: yarn
25+
26+
- name: Create Release Pull Request or Publish to npm
27+
id: changesets
28+
uses: changesets/action@v1
29+
with:
30+
# This expects you to have a script called release which does a build for your packages and calls changeset publish
31+
publish: yarn release
32+
createGithubReleases: true
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
37+
- name: Send a Slack notification if a publish happens
38+
if: steps.changesets.outputs.published == 'true'
39+
uses: slackapi/[email protected]
40+
with:
41+
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
42+
webhook-type: incoming-webhook
43+
payload: |
44+
text: "A new version of ${GITHUB_REPOSITORY} was published!"

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"build-cli": "cd packages/synthetic-chain && yarn build --silent",
88
"build": "yarn build-cli && synthetic-chain build",
99
"doctor": "yarn synthetic-chain doctor",
10+
"release": "yarn build-cli && yarn changeset publish",
1011
"test": "yarn build-cli && synthetic-chain test",
1112
"lint": "prettier --check ."
1213
},

0 commit comments

Comments
 (0)