forked from ua-parser/uap-python
-
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.
Also update the release workflow for the builtins: - configure `run-name` to print the inputs (otherwise they're not printed anywhere and it's hard to check them) - make the publish action `verbose` - don't fail testpypi on duplicates (easier to test workflow files)
- Loading branch information
Showing
2 changed files
with
56 additions
and
1 deletion.
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
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,49 @@ | ||
name: Publish ua-parser | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [created] | ||
|
||
env: | ||
ENVNAME: ${{ github.event_name == 'release' && 'pypi' || 'testpypi' }} | ||
ENVURL: https://${{ github.event_name != 'release' && 'test.' || '' }}pypy.org/p/ua-parser | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: $ENVNAME | ||
url: $ENVURL | ||
|
||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout working copy | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
- name: Install dependency | ||
run: | | ||
python -mpip install --upgrade pip | ||
python -mpip install build | ||
- name: Build sdist and wheel | ||
run: python -mbuild | ||
- name: Pyblish (testpypi) | ||
if: ${{ env.ENVNAME == 'testpypi' }} | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
skip-existing: true | ||
verbose: true | ||
password: ${{ secrets.PUBLISH_TOKEN }} | ||
- name: Publish (pypi) | ||
if: ${{ env.ENVNAME == 'pypi' }} | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
verbose: true | ||
password: ${{ secrets.PUBLISH_TOKEN }} |