|
| 1 | +# Bump the version for releases |
| 2 | +# Requires a .bumpversion.toml file in the root of the repository |
1 | 3 | name: Bump version |
2 | 4 |
|
3 | 5 | on: |
4 | 6 | workflow_dispatch: |
5 | 7 | inputs: |
6 | | - bump-type: |
7 | | - description: 'Bump type' |
| 8 | + bump_type: |
| 9 | + description: "Bump type" |
8 | 10 | required: true |
9 | | - default: 'patch' |
| 11 | + default: "patch" |
10 | 12 | type: choice |
11 | 13 | options: |
12 | | - - major |
13 | | - - minor |
14 | | - - patch |
15 | | - create_tag: |
16 | | - description: "create tag" |
17 | | - required: false |
18 | | - type: boolean |
19 | | - default: false |
| 14 | + - prerelease |
| 15 | + - patch |
| 16 | + - minor |
| 17 | + - major |
20 | 18 |
|
21 | 19 | jobs: |
22 | | - build: |
23 | | - runs-on: ubuntu-latest |
24 | | - steps: |
25 | | - - name: Checkout the code |
26 | | - uses: actions/checkout@v4 |
27 | | - |
28 | | - - name: Bump version |
29 | | - id: bump |
30 | | - uses: callowayproject/bump-my-version@master |
31 | | - env: |
32 | | - BUMPVERSION_TAG: "false" |
33 | | - with: |
34 | | - args: ${{ inputs.bump-type }} |
35 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
36 | | - |
37 | | - - name: Create a pull request |
38 | | - id: create-pull-request |
39 | | - if: steps.bump.outputs.bumped == 'true' |
40 | | - uses: peter-evans/create-pull-request@v7 |
41 | | - with: |
42 | | - token: ${{ secrets.GITHUB_TOKEN }} |
43 | | - base: main |
44 | | - branch: "bump-version-${{ steps.bump.outputs.current-version }}" |
45 | | - title: "[VERSION] Bump version to ${{ steps.bump.outputs.current-version }}" |
46 | | - body: "This PR bumps the project version to ${{ steps.bump.outputs.current-version }}." |
47 | | - labels: |
48 | | - automated pr |
49 | | - assignees: sophia-maedler |
50 | | - delete-branch: true |
51 | | - |
52 | | - - name: Create tag |
53 | | - if: inputs.create_tag == 'true' && steps.bump.outputs.bumped == 'true' |
54 | | - uses: actions/github-script@v5 |
55 | | - with: |
56 | | - script: | |
57 | | - github.rest.git.createRef({ |
58 | | - owner: context.repo.owner, |
59 | | - repo: context.repo.repo, |
60 | | - ref: 'refs/tags/v${{ steps.bump.outputs.current-version }}', |
61 | | - sha: '${{ steps.create-pull-request.outputs.pull-request-head-sha }}' |
62 | | - }) |
63 | | -
|
64 | | - - name: Check |
65 | | - if: steps.bump.outputs.bumped == 'true' |
66 | | - run: | |
67 | | - echo "Version was bumped from ${{ steps.bump.outputs.previous-version }} to ${{ steps.bump.outputs.current-version }}!" |
| 20 | + bump-version: |
| 21 | + uses: MannLabs/alphashared/.github/workflows/bump_version.yml@v1 |
| 22 | + secrets: inherit |
| 23 | + with: |
| 24 | + bump_type: ${{inputs.bump_type}} |
0 commit comments