-
Notifications
You must be signed in to change notification settings - Fork 4
54 lines (51 loc) · 1.57 KB
/
main.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
50
51
52
53
54
name: Python API CLient
on: push
jobs:
test:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install requirements
run: pip install tox twine -r requirements.txt -r test-requirements.txt
# Open-api-generator is broken. To be updated when upgrading
# - name: test
# run: tox
- name: Check Readme syntax
run: |
python setup.py sdist
twine check dist/*
# taken from https://python-semantic-release.readthedocs.io/en/latest/migrating_from_v7.html
release:
runs-on: self-hosted
needs: test
if: contains('
refs/heads/master
refs/heads/main'
, github.ref)
concurrency: release
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install ci requirements
run: pip install -r ci-requirements.txt
- name: Release
run: |
git config --global user.email "[email protected]"
git config --global user.name "GA"
PYTHONPATH=$PWD semantic-release version
PYTHONPATH=$PWD twine upload --non-interactive dist/*
PYTHONPATH=$PWD semantic-release publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}