-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (48 loc) · 1.67 KB
/
version_upgrade.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
# This workflow is used in bump_version and release workflows. It
# install poetry and updates the version of the code. It gives back
# the new version which can be used in the consequent workflows.
name: Version upgrade with poetry
on:
workflow_call:
inputs:
release_type:
required: true
type: string
outputs:
project_version:
value: ${{ jobs.upgrade-version.outputs.job_output_version}}
jobs:
upgrade-version:
runs-on: ubuntu-latest
outputs:
job_output_version: ${{ steps.get-version.outputs.PROJECT_VERSION}}
steps:
- name: checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.VERSION_DECOIMPACT }}
fetch-depth: 0
- name: install python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.4.2
- name: bump version and update template_input.yaml
id: get-version
run: |
git config user.name github-actions
git config user.email [email protected]
poetry version ${{ inputs.release_type }}
PROJECT_VERSION=$(poetry version --short)
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_OUTPUT
sed -i "1 s/.*/version: $PROJECT_VERSION/" template_input.yaml
- name: commit changes
run: |
PROJECT_VERSION=$(poetry version --short)
git add template_input.yaml
git add pyproject.toml
git commit -m "bump ${{ inputs.release_type }} version: ${{ steps.get-version.outputs.PROJECT_VERSION }}"
git push