Skip to content

Commit

Permalink
add version update cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
adraismawur committed Dec 12, 2024
1 parent bbe9ad1 commit 3acf7a0
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# from https://github.com/actinia-org/actinia-core/blob/main/.github/workflows/update-version.yml
name: Update Version Number

on:
release:
types: [published]

jobs:
update-version-number:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Update Version Number
run: |
OLD_VERSION=$(grep ^version pyproject.toml | cut -d '"' -f 2)
OLD_VERSION="\"$OLD_VERSION\""
NEW_VERSION="\"$GITHUB_REF_NAME\""
sed -i "s+version = $OLD_VERSION+version = $NEW_VERSION+g" pyproject.toml
- name: Commit Changes
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git commit -a -m "Update version number to new_version"
git push origin HEAD:main

0 comments on commit 3acf7a0

Please sign in to comment.