This repository was archived by the owner on Jul 13, 2026. It is now read-only.
release #1
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 | |
| permissions: {} | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Tag to release (e.g. v1.3.0)" | |
| required: true | |
| type: string | |
| prerelease: | |
| description: "Mark as prerelease" | |
| type: boolean | |
| default: false | |
| required: true | |
| draft: | |
| description: "Create as draft" | |
| type: boolean | |
| default: false | |
| required: true | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| - if: github.event_name == 'workflow_dispatch' | |
| run: | | |
| tag="${{ inputs.tag }}" | |
| if git rev-parse -q --verify "refs/tags/$tag" >/dev/null; then | |
| echo "Tag $tag exists" | |
| else | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git tag -a "$tag" -m "Release $tag" | |
| git push origin "$tag" | |
| fi | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| run_install: false | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: "pnpm" | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run fmt:check | |
| - run: pnpm run lint:check | |
| - run: pnpm run build | |
| - run: | | |
| tar -czf dist.tar.gz -C dist . | |
| sha256sum dist.tar.gz | tee dist.tar.gz.sha256 | |
| - id: meta | |
| run: | | |
| if [ "${{ github.event_name }}" = "push" ]; then | |
| echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.meta.outputs.tag }} | |
| name: ${{ steps.meta.outputs.tag }} | |
| draft: ${{ github.event_name == 'workflow_dispatch' && inputs.draft || false }} | |
| prerelease: ${{ github.event_name == 'workflow_dispatch' && inputs.prerelease || false }} | |
| files: | | |
| dist.tar.gz | |
| dist.tar.gz.sha256 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |