Skip to content

Commit

Permalink
Fix: get VERSION as env var
Browse files Browse the repository at this point in the history
  • Loading branch information
geode-main committed Mar 5, 2024
1 parent 1917126 commit 7576ab9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/pipy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish Python 🐍 distributions 📦 to PyPI
on:
push:
tags:
- "v*"
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
build-n-publish:
Expand All @@ -26,11 +26,23 @@ jobs:
with:
python-version: "3.10"

# Store the version, stripping any v-prefix
- name: Write release version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
# Use version in other step
- name: Read version
run: echo Version now: ${VERSION}

- name: Build source and wheel distributions
run: |
python -m pip install --upgrade build twine
python -m build
twine check --strict dist/*
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ We welcome contributions from the community! To contribute to this project, plea
## Release

- Use main branch for releases.
- Change .github/workflows/pipy_release.yml version first, then:
- test with ``VERSION=1.0.0 python -m build`` if you want, then:

``` bash
git tag -a "v0.0.1-beta" -m "beta version testing"
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from os import getenv

try:
from setuptools import setup
except ImportError:
from distutils.core import setup

setup(version='{{VERSION_PLACEHOLDER}}')
setup(version=getenv("VERSION"))

0 comments on commit 7576ab9

Please sign in to comment.