Skip to content

Commit

Permalink
Fix release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
c-randall committed Nov 13, 2024
1 parent 81eca09 commit 3d0cc13
Showing 1 changed file with 5 additions and 47 deletions.
52 changes: 5 additions & 47 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+b[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+'

env:
PACKAGE_NAME: '<PACKAGE_NAME>'

jobs:
details:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -48,7 +45,7 @@ jobs:

- name: Fetch info from PyPI
run: |
response=$(curl -s https://pypi.org/pypi/${{ env.PACKAGE_NAME }}/json || echo "{}")
response=$(curl -s https://pypi.org/pypi/thevenin/json || echo "{}")
latest_pypi_version=$(echo "$response" | jq -r '.releases | keys | .[]' | sort -rV | head -n 1)
if [[ -z "$latest_pypi_version" ]]; then
echo "Package not found on PyPI."
Expand Down Expand Up @@ -96,9 +93,9 @@ jobs:
- name: Verify tag and pyproject.toml versions match
run: |
python -m pip install --upgrade pip
pip install setuptools numpy cython
pip install .
PKG_VERSION=$(python setup.py --version)
PKG_VERSION=$(python -c "import thevenin; print(thevenin.__version__)")
TAG_VERSION=${{ needs.details.outputs.tag_version }}
if [[ "$PKG_VERSION" != "$TAG_VERSION" ]]; then
Expand All @@ -108,7 +105,7 @@ jobs:
echo "Package and tag versions match: $PKG_VERSION == $TAG_VERSION."
fi
build:
build-and-test:
name: (build ubuntu-latest, 3.13)
needs: [details, check-version]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -138,48 +135,9 @@ jobs:
name: builds
path: dist/*

test:
name: (test ${{ matrix.python-version }}, ${{ matrix.os }})
needs: build
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
python-version: ['3.13']

defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist/
pattern: builds*
merge-multiple: true

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install thevenin
run: pip install dist/*.whl -v

- name: Pytest
run: |
pip install pytest
pytest ./tests
pypi-publish:
name: Upload to PyPI
needs: test
needs: build-and-test
runs-on: ubuntu-latest

steps:
Expand Down

0 comments on commit 3d0cc13

Please sign in to comment.