forked from google-deepmind/lab2d
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.31 KB
/
pypi_upload.yml
File metadata and controls
52 lines (45 loc) · 1.31 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
51
52
# A workflow to upload releases to PyPi and TestPyPi.
name: pypi_upload
on:
workflow_dispatch:
inputs:
release:
description: 'Release to upload'
type: string
default: ''
upload_to_test_pypi:
description: 'Upload to Test PyPi'
type: boolean
default: true
upload_to_pypi:
description: 'Upload to PyPi'
type: boolean
default: false
release:
types: [published]
jobs:
upload-wheels-to-pypi:
name: Upload wheels to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/dmlab2d
permissions:
id-token: write
timeout-minutes: 30
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Download release assets
run: gh release download ${{ inputs.release || github.ref_name }} -D dist -R ${{ github.repository }}
- name: Publish to TestPyPI
if: github.event_name == 'release' || inputs.upload_to_test_pypi
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_name == 'release' || inputs.upload_to_pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true