From 92d0df9bdab92f76d3e7379d31750eb8b39950f3 Mon Sep 17 00:00:00 2001 From: itskalvik Date: Fri, 6 Dec 2024 11:18:13 -0600 Subject: [PATCH] Merge set package version action with build action --- .github/workflows/pypi-action.yml | 20 ++++++++++++++++++++ .github/workflows/version.yml | 21 --------------------- sgptools/__init__.py | 2 +- 3 files changed, 21 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/version.yml diff --git a/.github/workflows/pypi-action.yml b/.github/workflows/pypi-action.yml index ec6867b..febe8e7 100644 --- a/.github/workflows/pypi-action.yml +++ b/.github/workflows/pypi-action.yml @@ -4,7 +4,24 @@ on: release: types: [released] +permissions: + contents: write + jobs: + set-package-version: + name: Set python version + runs-on: ubuntu-latest + + steps: + - name: Check out Git repository + uses: actions/checkout@v4 + + - name: Set package version + run: sed -i "s/__version__ = .*/$(grep "__version__ = " setup.py)/" sgptools/__init__.py + + - name: Commit the changed file back to the repository + uses: stefanzweifel/git-auto-commit-action@v5 + build: name: Build distribution 📦 runs-on: ubuntu-latest @@ -13,6 +30,9 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set package version + run: | + sed -i "s/__version__ = .*/$(grep "__version__ = " setup.py)/" sgptools/__init__.py - name: Set up Python uses: actions/setup-python@v5 with: diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml deleted file mode 100644 index 4286956..0000000 --- a/.github/workflows/version.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Set python package version - -on: push - -permissions: - contents: write - -jobs: - run-linters: - name: Set python version - runs-on: ubuntu-latest - - steps: - - name: Check out Git repository - uses: actions/checkout@v4 - - - name: Set package version - run: sed -i "s/__version__ = .*/$(grep "__version__ = " setup.py)/" sgptools/__init__.py - - # Commit all changed files back to the repository - - uses: stefanzweifel/git-auto-commit-action@v5 diff --git a/sgptools/__init__.py b/sgptools/__init__.py index 89a9155..98dc943 100644 --- a/sgptools/__init__.py +++ b/sgptools/__init__.py @@ -12,7 +12,7 @@ """ -__version__ = "1.1.3" +__version__ = "1.1.2" __author__ = 'Kalvik' from .models.core import *