Skip to content

v2.0.3

v2.0.3 #5

Workflow file for this run

name: release-pipeline
on:
release:
types:
- created
jobs:
release-job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install release tooling
run: |
pip install hatch numpy
- name: Build package
run: |
hatch build
- name: Check version number match
run: |
echo "GITHUB_REF: ${GITHUB_REF}"
# The GITHUB_REF should be something like "refs/tags/v1.2.3"
# Extract version from tag (remove 'v' prefix if present)
TAG_VERSION=${GITHUB_REF:11}
TAG_VERSION=${TAG_VERSION#v}
# Get the version from the built package
PACKAGE_VERSION=$(hatch version)
echo "Tag version: $TAG_VERSION"
echo "Package version: $PACKAGE_VERSION"
# Check if versions match
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "Version mismatch: Tag version ($TAG_VERSION) does not match package version ($PACKAGE_VERSION)"
exit 1
fi
- uses: actions/upload-artifact@v4
with:
name: bdist
path: dist/*
pypi-publish:
needs: release-job
name: upload release to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: bdist
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
test-install-job:
needs: pypi-publish
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Give PyPI a chance to update the index
run: sleep 360
- name: Install from PyPI
run: |
pip install gEconpy==${GITHUB_REF:11}