Skip to content

Commit

Permalink
feature(package): Poetry is used for builds and publishing.
Browse files Browse the repository at this point in the history
  • Loading branch information
acederberg committed Aug 22, 2024
1 parent f3c1205 commit 6d0e917
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,27 @@ jobs:
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install build twine
python3 -m pip install twine poetry
- name: Build and Verify.
id: release-build-and-verify
run: |
source .venv/bin/activate
echo "## Build\n\n~~~stdout" >> $GITHUB_STEP_SUMMARY
python3 -m build >> $GITHUB_STEP_SUMMARY
poetry build >> $GITHUB_STEP_SUMMARY
echo "~~~\n\n## Twine Check\n\n~~~stdout" >> $GITHUB_STEP_SUMMARY
python3 -m twine check dist/* >> $GITHUB_STEP_SUMMARY
echo "~~~" >> $GITHUB_STEP_SUMMARY
- name: Publish to PyPI.
id: release-publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
run: |
source .venv/bin/activate
poetry config repositories.pypi pypi.org
poetry config pypi-token.pypi '${{ secrets.PYPI_TOKEN }}'
poetry publish
- name: Create Release
id: release-create
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install build twine bumpver
python3 -m pip install poetry twine bumpver
# NOTE: This will not be published so it is fine that it happens at this
# stage.
Expand All @@ -71,14 +71,18 @@ jobs:
source .venv/bin/activate
echo "## Build\n\n~~~stdout" >> $GITHUB_STEP_SUMMARY
python3 -m build >> $GITHUB_STEP_SUMMARY
poetry build >> $GITHUB_STEP_SUMMARY
echo "~~~\n\n## Twine Check\n\n~~~stdout" >> $GITHUB_STEP_SUMMARY
python3 -m twine check dist/* >> $GITHUB_STEP_SUMMARY
echo "~~~" >> $GITHUB_STEP_SUMMARY
# NOTE: Poetry does have versioning capabilities however they do not
# appear to have much of an advantage over bumpver.
- name: Increment Version.
id: bumpver-update
run: |
source .venv/bin/activate
echo "## Bumpver Data\n\n" >> $GITHUB_STEP_SUMMARY
echo "- kind: ${{ github.event.inputs.kind }}" >> $GITHUB_STEP_SUMMARY
echo "- kind_tag: ${{ github.event.inputs.kind_tag }}" >> $GITHUB_STEP_SUMMARY
Expand Down

0 comments on commit 6d0e917

Please sign in to comment.