-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (30 loc) · 935 Bytes
/
update-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
name: Update Version from pyproject.toml
on:
push:
paths:
- 'pyproject.toml'
branches-ignore:
- docs
workflow_dispatch:
concurrency: updates-project
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read Version
uses: SebRollen/toml-action@v1.2.0
id: read_vesion
with:
file: 'pyproject.toml'
field: 'project.version'
- name: Set version in code
run: |
echo "Setting version to ${{ steps.read_vesion.outputs.value }}"
sed -i 's/__version__ = "[0-9]\+\.[0-9]\+\.[0-9]\+"/__version__ = "${{ steps.read_vesion.outputs.value }}"/g' src/poodle/__init__.py
- name: commit-version
uses: EndBug/add-and-commit@v9
with:
add: "src/poodle/__init__.py"
pull: "--rebase=true --autostash"
message: ':robot: Update version to ${{ steps.read_vesion.outputs.value }}'