Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Undead34 committed Nov 1, 2024
2 parents b7b8ce0 + 397170a commit 1dd2ced
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Python Build Release

on:
push:
branches: [ "main" ]
paths:
- 'src/version.py'
- 'requirements.txt'
- 'CHANGELOG.md'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10.x'
architecture: 'x64'

- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pyinstaller
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Check version
id: version_check
run: |
version=$(python -c "from src.version import __version__; print(__version__)")
echo "Current version is $version"
echo "version=$version" >> $GITHUB_ENV
shell: bash

- name: Verify GitHub tag existence
id: tag_check
run: |
if git ls-remote --exit-code --tags origin "refs/tags/v${{ env.version }}" ; then
echo "Tag v${{ env.version }} already exists. Skipping release."
exit 1
else
echo "Tag v${{ env.version }} does not exist. Continuing."
fi
shell: bash

0 comments on commit 1dd2ced

Please sign in to comment.