various improvements #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build package and deploy on PyPi | ||
Check failure on line 1 in .github/workflows/release.yml GitHub Actions / Build package and deploy on PyPiInvalid workflow file
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
build-n-publish: | ||
name: Build and publish Python 🐍 distributions 📦 to PyPI | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
- name: Install pypa/build | ||
run: >- | ||
python3 -m | ||
pip install | ||
build | ||
--user | ||
- name: Change __version__ in setup.py | ||
if: ! startsWith(github.ref, 'refs/tags') | ||
run: >- | ||
release_number=$(python -c "from gazu import __version__; print(__version__)").dev$(git rev-parse --short HEAD) | ||
echo "__version__ = \"$release_number\"" > gazu/__version__.py | ||
- name: Build a binary wheel | ||
run: >- | ||
python3 -m | ||
build | ||
--wheel | ||
- name: Publish distribution 📦 to Test PyPI | ||
if: ! startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
- name: Publish distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 |