Skip to content

Commit

Permalink
Add auto-tag workflow (#21)
Browse files Browse the repository at this point in the history
* Add auto-tag workflow

* chore: bump version to 1.3.6
  • Loading branch information
aelmiger committed Jul 17, 2024
1 parent f4742fd commit bcf779c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/auto-tag.yaml
Original file line number Diff line number Diff line change
@@ -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 [email protected]
git tag ${{ steps.get_version.outputs.VERSION }}
git push origin ${{ steps.get_version.outputs.VERSION }}
3 changes: 3 additions & 0 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ name: Syclops Pipeline Test
on:
push:
branches: [ main ]
tags:
- 'v*' # This will match any tag starting with 'v'
pull_request:
branches: [ main ]

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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ readme = "README.md"
requires-python = ">=3.8"
license = {text = "GPLv3"}

version = "1.3.5"
version = "1.3.6"

dynamic = ["dependencies"]

Expand Down

0 comments on commit bcf779c

Please sign in to comment.