diff --git a/.github/actions/bump/action.yml b/.github/actions/bump/action.yml new file mode 100644 index 0000000000..1c580117ba --- /dev/null +++ b/.github/actions/bump/action.yml @@ -0,0 +1,38 @@ +name: Bump version +description: Bump the version of Bun + +inputs: + version: + description: The most recent version of Bun. + required: true + type: string + +runs: + using: composite + steps: + - name: Run Bump + shell: bash + id: bump + run: | + set -euo pipefail + MESSAGE=$(bun ./scripts/bump.ts patch --last-version=${{ inputs.version }}) + LATEST=$(cat LATEST) + echo "version=$LATEST" >> $GITHUB_OUTPUT + echo "message=$MESSAGE" >> $GITHUB_OUTPUT + - name: Create Pull Request + uses: peter-evans/create-pull-request@v4 + with: + add-paths: | + CMakeLists.txt + LATEST + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Bump version to ${{ steps.bump.outputs.version }} + title: Bump to ${{ steps.bump.outputs.version }} + delete-branch: true + branch: github-actions/bump-version-${{ steps.bump.outputs.version }} + body: | + ## What does this PR do? + + ${{ steps.bump.outputs.message }} + + Auto-bumped by [this workflow](https://github.com/oven-sh/bun/actions/workflows/release.yml) diff --git a/.github/workflows/test-bump.yml b/.github/workflows/test-bump.yml new file mode 100644 index 0000000000..906e1ace76 --- /dev/null +++ b/.github/workflows/test-bump.yml @@ -0,0 +1,28 @@ +name: Test Bump version + +on: + workflow_dispatch: + inputs: + version: + type: string + description: What is the release tag? (e.g. "1.0.2", "canary") + required: true + +jobs: + bump: + name: "Bump version" + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Bun + uses: ./.github/actions/setup-bun + with: + bun-version: "1.1.12" + - name: Bump version + uses: ./.github/actions/bump + with: + version: ${{ inputs.version }}