-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.46 KB
/
release_pypi.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
48
49
---
name: Release
'on':
workflow_dispatch:
inputs:
pypi:
description: 'Release production/testing ?'
required: true
default: 'testing'
jobs:
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
env:
python: 3.9
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: ${{ env.python }}
- name: Install twine
run: pip install twine==4.0.1
- name: Extract release
id: release_extraction
run: echo ${{ github.ref }} | sed 's/refs\///g' | xargs -I{} echo 'tag={}' >> $GITHUB_OUTPUT
- uses: dsaltares/fetch-gh-release-asset@master
with:
version: ${{ steps.release_extraction.outputs.tag }}
file: 'matrix_synapse_testutils.*'
token: ${{ github.token }}
regex: true
target: assets/
- run: ls assets/
- name: Upload to testpypi
if: ${{ github.event.inputs.pypi == 'testing' }}
run: python -m twine upload assets/*
env:
TWINE_REPOSITORY: testpypi
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TESTPYPI_API_TOKEN }}
- name: Upload to pypi
if: ${{ github.event.inputs.pypi == 'production' }}
run: python -m twine upload assets/*
env:
TWINE_REPOSITORY: pypi
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}