-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (72 loc) · 2.08 KB
/
release.yaml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Release
on:
push:
tags:
- '[0-9].[0-9]+.[0-9]+'
jobs:
build:
name: Build packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: install Poetry
run: python -m pip install poetry
- name: poetry build
run: poetry build
- uses: actions/upload-artifact@v3
with:
name: poetry_build
path: dist/
# Test-PyPi release
publish_test:
name: Publish on TestPyPi
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: actions/download-artifact@v3
with:
name: poetry_build
path: dist/
- name: Display structure of downloaded files
run: ls -R
- name: install Poetry
run: python -m pip install poetry
- name: poetry configure TestPyPI Repo
run: poetry config repositories.test-pypi https://test.pypi.org/legacy/
- name: poetry configure TestPyPI Token
run: poetry config pypi-token.test-pypi ${{ secrets.PYPI_TEST }}
- name: poetry publish TestPyPi
run: poetry publish -r test-pypi
# Get calls only, if publish on Test-PyPi has worked.
publish_oficial:
name: Publish on PyPi
runs-on: ubuntu-latest
needs: publish_test
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: actions/download-artifact@v3
with:
name: poetry_build
path: dist/
- name: Display structure of downloaded files
run: ls -R
# PyPi Release
- name: install Poetry
run: python -m pip install poetry
- name: poetry configure PyPI Token
run: poetry config pypi-token.pypi ${{ secrets.PYPI }}
- name: poetry publish PyPi
run: poetry publish