-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (42 loc) · 1.22 KB
/
publish.yml
File metadata and controls
50 lines (42 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Publish to PyPI
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to publish to'
required: true
default: 'testpypi'
type: choice
options:
- testpypi
- pypi
jobs:
publish:
runs-on: ubuntu-latest
environment:
name: ${{ github.event.inputs.environment }}
url: ${{ github.event.inputs.environment == 'pypi' && 'https://pypi.org/p/wav2aug' || 'https://test.pypi.org/p/wav2aug' }}
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Build package
run: uv build
- name: Publish to Test PyPI
if: github.event.inputs.environment == 'testpypi'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
- name: Publish to PyPI
if: github.event.inputs.environment == 'pypi'
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true