Publish ua-parser #3
Workflow file for this run
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
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: ${{ env.ENVNAME }} | ||
Check failure on line 17 in .github/workflows/release-main.yml GitHub Actions / Publish ua-parserInvalid workflow file
|
||
url: ${{ env.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: 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 }} |