Skip to content

Commit

Permalink
Added workflow to release to test pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
maerteijn committed Oct 9, 2023
1 parent 55dde97 commit 3fd907e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/publish-pypi-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish to pypi test
on: workflow_dispatch

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install wheel
run: pip install wheel
- name: Build a binary wheel
run: make wheel
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: update-netrc-wheels
path: dist/

publish-to-pypi-test:
name: Publish wheel to pypi test
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://test.pypi.org/p/update-netrc
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download the wheels
uses: actions/download-artifact@v3
with:
name: update-netrc-wheels
path: dist/
- name: Publish wheel to pypi test
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ format:
wheel:
pip wheel . -w dist

publish-release-testpypi: wheel
publish-release-pypi-test: wheel
twine upload --repository testpypi dist/*

publish_release: build_release
publish_release-pypi: build_release
twine upload dist/*

0 comments on commit 3fd907e

Please sign in to comment.