chore: bump version to v1.1.0 #5
Workflow file for this run
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: | |
| tags: | |
| - "v*.*.*" | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version to release (e.g., v1.2.3)" | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Run tests | |
| run: bun run test | |
| - name: Build and package | |
| run: | | |
| bun run build | |
| bun run package | |
| - name: Get version from tag | |
| id: get_version | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| VERSION="${{ github.event.inputs.version }}" | |
| else | |
| VERSION=${GITHUB_REF#refs/tags/} | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "major_version=$(echo $VERSION | cut -d. -f1)" >> $GITHUB_OUTPUT | |
| - name: Update major version tag | |
| run: | | |
| MAJOR_VERSION=${{ steps.get_version.outputs.major_version }} | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| # Delete existing tag if it exists | |
| git tag -d $MAJOR_VERSION || true | |
| git push origin :refs/tags/$MAJOR_VERSION || true | |
| # Create new tag | |
| git tag -a $MAJOR_VERSION -m "Update $MAJOR_VERSION tag" | |
| git push origin $MAJOR_VERSION | |
| - name: Update release branch | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| # Delete existing release branch if it exists | |
| git push origin :release || true | |
| git branch -D release || true | |
| # Create new release branch | |
| git checkout -B release | |
| git push origin release | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.get_version.outputs.version }} | |
| name: Release ${{ steps.get_version.outputs.version }} | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |