-
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.
- Loading branch information
1 parent
e599fde
commit 15a56e9
Showing
1 changed file
with
47 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Publish to Test PyPI | ||
|
||
on: | ||
push: | ||
branches: ["develop", "main"] | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
environment: release | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
- name: Install dependencies | ||
run: | | ||
# python -m pip install --upgrade pip | ||
pip install hatch | ||
- name: Build package | ||
run: hatch build | ||
# - name: Test package | ||
# run: hatch -e test run nose2 --verbose | ||
- name: Publish package distributions to Test PyPI | ||
if: github.ref != 'refs/heads/main' | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
skip-existing: true | ||
repository-url: https://test.pypi.org/legacy/ | ||
- name: Publish package distributions to PyPI | ||
if: github.ref == 'refs/heads/main' | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
skip-existing: true | ||
repository-url: https://upload.pypi.org/legacy/ |