chore: migrate astro configs (#1660) #14
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: | |
| - master | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| detect: | |
| name: Detect changes | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| outputs: | |
| registry: ${{ steps.filter.outputs.registry }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - id: filter | |
| uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 | |
| with: | |
| filters: | | |
| registry: | |
| - 'registry/src/**' | |
| prepare: | |
| name: Prepare | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup | |
| - name: Create Release Pull Request | |
| id: changesets | |
| uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0 | |
| with: | |
| version: pnpm ci:version | |
| commit: "chore: version packages" | |
| title: "chore: version packages" | |
| createGithubReleases: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish: | |
| name: Publish | |
| needs: detect | |
| permissions: | |
| contents: read | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup | |
| - name: Update registry version | |
| if: needs.detect.outputs.registry == 'true' | |
| run: | | |
| cd registry | |
| VERSION="0.0.$(date -u +%Y%m%d%H%M%S)" | |
| echo "Setting registry version to ${VERSION}" | |
| npm pkg set version="${VERSION}" | |
| - name: Build packages | |
| run: pnpm build:package | |
| - name: Publish to NPM | |
| run: | | |
| if [ -f .changeset/pre.json ]; then | |
| pnpm ci:publish:beta | |
| else | |
| pnpm ci:publish:latest | |
| fi | |
| github-release: | |
| name: Create GitHub release | |
| needs: publish | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Read release tag | |
| run: | | |
| v=$(jq -r .version packages/prosekit/package.json) | |
| echo "RELEASE_TAG=v${v}" >> "$GITHUB_ENV" | |
| - name: Create GitHub release | |
| continue-on-error: true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TARGET_SHA: ${{ github.sha }} | |
| run: | | |
| gh release create "${RELEASE_TAG}" \ | |
| --target "${TARGET_SHA}" \ | |
| --title "${RELEASE_TAG}" \ | |
| --notes "Please refer to [CHANGELOG.md](https://github.com/ocavue/prosekit/blob/${RELEASE_TAG}/packages/prosekit/CHANGELOG.md) for details." |