chore: Lock file maintenance (#9098) #6250
This file contains hidden or 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: | |
| - main | |
| workflow_dispatch: | |
| 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/affine/all/package.json) | |
| echo "BLOCKSUITE_RELEASE_TAG=v${BLOCKSUITE_VERSION}" >> "$GITHUB_ENV" | |
| - name: Create GitHub release | |
| id: release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| commit: main | |
| tag: '${{ env.BLOCKSUITE_RELEASE_TAG }}' | |
| # We dont' have changelog now. Need to add it back. | |
| # 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/slack-github-action@v2.0.0 | |
| with: | |
| webhook: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| webhook-type: incoming-webhook | |
| payload: | | |
| { "message": "[BlockSuite Release]: New BlockSuite version ${{ env.BLOCKSUITE_RELEASE_TAG }} has been released to NPM." } |