Bump Package Version #174
This file contains 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: Bump Package Version | |
on: | |
workflow_dispatch: | |
inputs: | |
bump: | |
required: true | |
description: 'Release Type' | |
type: choice | |
default: 'patch' | |
options: | |
- patch | |
- minor | |
- major | |
jobs: | |
bump-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Node setup | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Prepare checkout token | |
id: generate_token | |
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 | |
with: | |
app_id: ${{ secrets.TEMPORAL_CICD_APP_ID }} | |
private_key: ${{ secrets.TEMPORAL_CICD_PRIVATE_KEY }} | |
- name: Configure Git | |
run: | | |
git config --local user.name 'Temporal Data (cicd)' | |
git config --local user.email '[email protected]' | |
- name: Bump version | |
run: npm version --no-commit-hooks ${{ inputs.bump }} | |
- name: Create Pull Request | |
run: | | |
version=`git describe --abbrev=0 --tags` | |
branch="releases/$version" | |
git checkout -b $branch | |
git remote set-url origin "https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/${{ github.repository }}" | |
git push origin $branch | |
gh pr create -B main -H $branch --title "bump version in package.json to $version" --body "release version $version" | |
env: | |
GH_TOKEN: ${{ steps.generate_token.outputs.token }} |