-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (71 loc) · 2.14 KB
/
increase_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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Increase version
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatchinputs
on:
workflow_dispatch:
inputs:
nextVersionMajor:
description: "The next version that will be released"
required: true
type: choice
options:
- "0"
- "1"
- "2"
- "3"
- "4"
- "5"
- "6"
- "7"
- "8"
- "9"
nextVersionMinor:
description: "The next version that will be released"
required: true
type: choice
options:
- "0"
- "1"
- "2"
- "3"
- "4"
- "5"
- "6"
- "7"
- "8"
- "9"
nextVersionPatch:
description: "The next version that will be released"
required: true
type: choice
options:
- "0"
- "1"
- "2"
- "3"
- "4"
- "5"
- "6"
- "7"
- "8"
- "9"
jobs:
create_pull_request:
name: "Create Pull Request"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build version
run: echo "new_version=${{ inputs.nextVersionMajor }}.${{ inputs.nextVersionMinor }}.${{ inputs.nextVersionPatch }}" >> $GITHUB_ENV
- name: Replace version in src/nester/__init__.py
run: sed -i 's/__version__ = "[0-9].[0-9].[0-9]"/__version__ = "'${{ env.new_version }}'"/g' src/nester/__init__.py
- name: Replace release in docs/conf.py
run: sed -i 's/release = "[0-9].[0-9].[0-9]"/release = "'${{ env.new_version }}'"/g' docs/conf.py
- name: Replace version in docs/conf.py
run: sed -i 's/version = "[0-9].[0-9]"/version = "'${{ inputs.nextVersionMajor }}'.'${{ inputs.nextVersionMinor }}'"/g' docs/conf.py
- name: Create Pull Request
# https://github.com/peter-evans/create-pull-request
uses: peter-evans/create-pull-request@v4
with:
commit-message: "[Bot] Update version to ${{ env.new_version }}"
delete-branch: true
title: "[Bot] Update project version to ${{ env.new_version }}"