Skip to content

Commit

Permalink
Update python-package.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Undead34 authored Nov 1, 2024
1 parent f4ce0eb commit 397170a
Showing 1 changed file with 35 additions and 7 deletions.
42 changes: 35 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,50 @@
name: Python package
name: Python Build Release

on: [push]
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
# This is the version of the action for setting up Python, not the Python version.
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.10.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# You can test your matrix by printing the current Python version

- 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 397170a

Please sign in to comment.