-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.39 KB
/
publish.yml
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
# Tools to publish package to pypi automatically
# on update of poetry version.
# Will also update tags on automatic release.
name: "Publish package"
# don't allow multiple 'identical' processes to run. A second push should cancel the job from the first one.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}-${{ github.event.inputs.pypi }}-${{ github.event.inputs.testpypi }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
pypi:
description: Force to pypi
type: boolean
default: false
testpypi:
description: Force to testpypi
type: boolean
default: false
push:
branches: [main]
jobs:
publish-manual:
if: ${{ github.event.inputs.testpypi == 'true' || github.event.inputs.pypi == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build and publish to pypi
if: ${{ github.event.inputs.pypi == 'true' }}
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
- name: Build and publish to testpypi
if: ${{ github.event.inputs.testpypi == 'true' }}
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.TEST_PYPI_TOKEN }}
repository_name: "testpypi"
repository_url: "https://test.pypi.org/legacy/"