diff --git a/.github/workflows/auto-tag.yaml b/.github/workflows/auto-tag.yaml new file mode 100644 index 0000000..0fc788d --- /dev/null +++ b/.github/workflows/auto-tag.yaml @@ -0,0 +1,35 @@ +on: + push: + branches: + - main + +jobs: + auto-tag: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get version from pyproject.toml + id: get_version + run: | + VERSION=$(grep '^version =' pyproject.toml | awk -F'"' '{print $2}') + echo "VERSION=v$VERSION" >> $GITHUB_OUTPUT + + - name: Check if tag exists + id: check_tag + run: | + if git rev-parse "${{ steps.get_version.outputs.VERSION }}" >/dev/null 2>&1; then + echo "TAG_EXISTS=true" >> $GITHUB_OUTPUT + else + echo "TAG_EXISTS=false" >> $GITHUB_OUTPUT + fi + + - name: Create and push tag + if: steps.check_tag.outputs.TAG_EXISTS == 'false' + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git tag ${{ steps.get_version.outputs.VERSION }} + git push origin ${{ steps.get_version.outputs.VERSION }} diff --git a/.github/workflows/integration_test.yaml b/.github/workflows/integration_test.yaml index 142e7cf..8ae1246 100644 --- a/.github/workflows/integration_test.yaml +++ b/.github/workflows/integration_test.yaml @@ -3,6 +3,8 @@ name: Syclops Pipeline Test on: push: branches: [ main ] + tags: + - 'v*' # This will match any tag starting with 'v' pull_request: branches: [ main ] @@ -10,6 +12,7 @@ jobs: build-and-test: name: Syclops Pipeline Test runs-on: ubuntu-latest + if: github.event_name == 'pull_request' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) steps: - name: Checkout repository diff --git a/pyproject.toml b/pyproject.toml index 10f3424..ab06431 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ readme = "README.md" requires-python = ">=3.8" license = {text = "GPLv3"} -version = "1.3.5" +version = "1.3.6" dynamic = ["dependencies"]