Skip to content

Use version from python instead of pip #6

Use version from python instead of pip

Use version from python instead of pip #6

Workflow file for this run

name: Generate release (Pypi, tag, & GitHub Release)
on:
workflow_dispatch:
push:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@main
- name: Set up Python
uses: actions/setup-python@main
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Install Package
run: pip install -e .
- name: Get package version
id: version
run: |
export VERSION=$(python -c "import importlib.metadata; print(importlib.metadata.version(\"${{ vars.MODULE_NAME }}\")))"
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Version number: $VERSION"
#- name: Build and publish
# env:
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# run: |
# python setup.py sdist bdist_wheel
# twine upload dist/* -c "${{ secrets.PYPI_COMMENT }}"
- name: Generate tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.version.outputs.VERSION }}
- name: Create a GitHub release
uses: ncipollo/release-action@main
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: ${{ steps.version.outputs.VERSION }}