-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from small-thinking/update-gha
Update GHA
- Loading branch information
Showing
2 changed files
with
13 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
name: Publish Python Package to PyPI | ||
|
||
# Trigger the workflow when a tag is pushed with a version starting with 'v' | ||
on: | ||
push: | ||
tags: | ||
|
@@ -15,19 +14,28 @@ jobs: | |
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
# Step name: Build package | ||
- name: Extract version from tag | ||
id: get_version | ||
run: echo "::set-output name=VERSION::${GITHUB_REF#refs/tags/v}" | ||
shell: bash | ||
|
||
- name: Echo the package version | ||
run: | | ||
echo "Package version: ${{ steps.get_version.outputs.VERSION }}" | ||
# Assuming setup.py reads the version from a source that is updated to match the tag, | ||
# or you're using a tool to sync them. | ||
- name: Build package | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
# Step name: Publish to PyPI | ||
- name: Publish to PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
|
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