forked from meltano/meltano
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (82 loc) · 2.72 KB
/
version_bump.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Version bump
on:
workflow_dispatch:
inputs:
bump:
description: "Version bump type"
required: true
type: choice
default: auto
options:
- auto
- patch
- minor
- major
prerelease:
description: "Increase to this prerelease version"
required: false
type: choice
default: none
options:
- none
- alpha
- beta
- rc
jobs:
create_release_branch_pr:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
permissions:
contents: write # to create a github release
pull-requests: write # to create and update PRs
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.10"
architecture: x64
- name: Bump version
id: cz-bump
uses: commitizen-tools/[email protected]
with:
increment: ${{ github.event.inputs.bump != 'auto' && github.event.inputs.bump || '' }}
prerelease: ${{ github.event.inputs.prerelease != 'none' && github.event.inputs.prerelease || '' }}
commit: "false"
push: "false"
changelog: "true"
github_token: ${{ secrets.MELTYBOT_GITHUB_AUTH_TOKEN }}
extra_requirements: 'git+https://github.com/meltano/commitizen-version-bump@main'
changelog_increment_filename: _changelog_fragment.md
- name: Draft Release
id: draft-release
uses: softprops/action-gh-release@v1
with:
draft: true
body_path: _changelog_fragment.md
tag_name: v${{ steps.cz-bump.outputs.version }}
prerelease: ${{ github.event.inputs.prerelease != 'none' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
id: create-pull-request
with:
# https://github.com/peter-evans/create-pull-request
commit-message: "chore: Bump package version"
title: "chore: Release v${{ steps.cz-bump.outputs.version }}"
body: |
Bump changelog for release v${{ steps.cz-bump.outputs.version }}
branch: release/v${{ steps.cz-bump.outputs.version }}
base: main
labels: release
- name: Approve Pull Request
if: ${{ steps.create-pull-request.outputs.pull-request-number != 0 }}
uses: juliangruber/[email protected]
with:
# https://github.com/juliangruber/approve-pull-request-action
github-token: ${{ secrets.MELTYBOT_GITHUB_AUTH_TOKEN }}
number: ${{ steps.create-pull-request.outputs.pull-request-number }}