-
-
Notifications
You must be signed in to change notification settings - Fork 425
77 lines (64 loc) · 2.15 KB
/
release.yml
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
name: Release
on:
push:
branches:
- master
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
id-token: write
contents: write
pull-requests: write
jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Create Release Pull Request
id: changesets
uses: changesets/action@v1
with:
version: yarn ci:version
commit: 'chore: version packages'
title: 'chore: version packages'
createGithubReleases: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Build packages
run: yarn build:packages
- name: Publish to NPM
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
yarn config set npmAuthToken ${{ secrets.NPM_TOKEN }}
yarn ci:publish
rm ".npmrc"
yarn config unset npmAuthToken
- name: Get package version
run: |
BLOCKSUITE_VERSION=$(jq -r ".version" packages/blocks/package.json)
echo "BLOCKSUITE_RELEASE_TAG=v${BLOCKSUITE_VERSION}" >> "$GITHUB_ENV"
- name: Create GitHub release
id: release
uses: ncipollo/release-action@v1
with:
commit: master
tag: '${{ env.BLOCKSUITE_RELEASE_TAG }}'
body: 'Please refer to [CHANGELOG.md](https://github.com/toeverything/blocksuite/blob/${{ env.BLOCKSUITE_RELEASE_TAG }}/packages/blocks/CHANGELOG.md) for details.'
token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Send release notification
if: steps.release.outcome == 'success'
id: slack
uses: slackapi/[email protected]
with:
payload: |
{ "message": "[BlockSuite Release]: New BlockSuite version ${{ env.BLOCKSUITE_RELEASE_TAG }} has been released to NPM." }
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}