forked from wandb/wandb
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (55 loc) · 1.59 KB
/
bump-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
50
51
52
53
54
55
56
name: Bump version and generate changelog
on:
workflow_call:
inputs:
branch:
required: true
type: string
bump-kind:
required: true
type: string
default: "PATCH"
outputs:
version:
value: ${{ jobs.bump-version.outputs.version }}
branch:
value: ${{ jobs.bump-version.outputs.branch }}
tag:
value: ${{ jobs.bump-version.outputs.tag }}
workflow_dispatch:
inputs:
bump-kind:
type: choice
required: true
description: How to bump the current version
default: "PATCH"
options:
- "MAJOR"
- "MINOR"
- "PATCH"
jobs:
bump-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.cz.outputs.version }}
branch: ${{ steps.cz.outputs.branch }}
tag: ${{ steps.cz.outputs.tag }}
steps:
- name: Checkout out
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
fetch-depth: 0
token: "${{ secrets.GITHUB_API_TOKEN }}"
- id: cz
name: Create bump and changelog
uses: commitizen-tools/[email protected]
with:
github_token: ${{ secrets.GITHUB_API_TOKEN }}
branch: "bump-version-test"
increment: ${{ github.event.inputs.bump-kind }}
- name: Print Version
run: |
echo "version=${{ steps.cz.outputs.version }}" >> $GITHUB_OUTPUT
echo "branch=release-${{ steps.cz.outputs.version }}" >> $GITHUB_OUTPUT
echo "tag=v${{ steps.cz.outputs.version }}" >> $GITHUB_OUTPUT