chore: release blocksuite (#8990) #6177
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |