Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Publish Python distribution to PyPI and TestPyPI
name: Publish ua-parser builtins

run-name: Publish ${{ inputs.tag || 'master' }} to ${{ inputs.environment || 'dummy' }}

on:
schedule:
Expand Down Expand Up @@ -67,6 +69,8 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
verbose: true

publish-to-pypi:
name: publish
Expand All @@ -88,3 +92,5 @@ jobs:
path: dist/
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
49 changes: 49 additions & 0 deletions .github/workflows/release-main.yml
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: ${{ github.event_name == 'release' && 'pypi' || 'testpypi' }}
url: https://${{ github.event_name != 'release' && 'test.' || '' }}pypy.org/p/ua-parser

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: Publish to 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 to pypi
if: ${{ env.ENVNAME == 'pypi' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
password: ${{ secrets.PUBLISH_TOKEN }}