-
Notifications
You must be signed in to change notification settings - Fork 71
49 lines (46 loc) · 1.57 KB
/
bump-package-version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 }}