-
-
Notifications
You must be signed in to change notification settings - Fork 73
63 lines (61 loc) · 1.71 KB
/
release.yaml
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
57
58
59
60
61
62
63
name: Release
on:
workflow_dispatch:
inputs:
increment:
description: "Increment"
required: false
default: "MINOR"
type: choice
options: [MAJOR, MINOR, PATCH]
prerelease:
description: "Prerelease"
required: true
default: true
type: boolean
dry_run:
description: "Dry run"
required: true
default: false
type: boolean
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: "Set prerelease argument"
run: |
if ${{ inputs.prerelease }} == true; then
echo "PRERELEASE_ARG=--prerelease beta" >> $GITHUB_ENV
else
echo "PRERELEASE_ARG=" >> $GITHUB_ENV
fi
- name: "Set dry run argument"
run: |
if ${{ inputs.dry_run }} == true; then
echo "DRY_RUN_ARG=--dry-run" >> $GITHUB_ENV
else
echo "DRY_RUN_ARG=" >> $GITHUB_ENV
fi
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install commitizen
- name: Configure git
run: |
git config --global user.name 'xaviml'
git config --global user.email '[email protected]'
- name: Bump version
run: cz bump --increment ${{ inputs.increment }} ${PRERELEASE_ARG} ${DRY_RUN_ARG}
- name: Push tag
if: "!inputs.dry_run"
uses: ad-m/github-push-action@master
with:
branch: main
github_token: ${{ secrets.PAT }}
tags: true