Release #4
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: | |
| workflow_dispatch: | |
| inputs: | |
| channel: | |
| description: "Release channel" | |
| required: true | |
| type: choice | |
| options: | |
| - next | |
| - finalize | |
| - stable | |
| default: next | |
| bump: | |
| description: "Version bump (next and stable only)" | |
| required: false | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| default: patch | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Release (${{ inputs.channel }}${{ inputs.channel != 'finalize' && format(' {0}', inputs.bump) || '' }}) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git checkout main | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Bump version, commit, and tag | |
| run: | | |
| if [ "${{ inputs.channel }}" = "next" ]; then | |
| bun run release next ${{ inputs.bump }} | |
| elif [ "${{ inputs.channel }}" = "finalize" ]; then | |
| bun run release finalize | |
| else | |
| bun run release ${{ inputs.bump }} | |
| fi | |
| - name: Create GitHub Release | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| if [[ "$VERSION" == *"-next."* ]]; then | |
| gh release create "v${VERSION}" --generate-notes --prerelease | |
| else | |
| gh release create "v${VERSION}" --generate-notes | |
| fi | |
| env: | |
| GH_TOKEN: ${{ github.token }} |