-
Notifications
You must be signed in to change notification settings - Fork 16
61 lines (57 loc) · 1.62 KB
/
test_and_release.yml
File metadata and controls
61 lines (57 loc) · 1.62 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
53
54
55
56
57
58
59
60
61
name: Build 📦
on:
- push
- pull_request
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
steps:
- uses: actions/checkout@v2
- name: Test
uses: ./.github/actions/test
with:
python-version: ${{ matrix.python-version }}
pytest-args: '--cov-config .coveragerc --cov=json_to_models'
# - name: Coverage
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# coverage xml
# coveralls --service=github
# TODO: Fix codacy issue with token
# python-codacy-coverage -r coverage.xml
release:
name: Build and publish
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install deps
run: |
python -m pip install --upgrade pip build
pip install setuptools wheel twine
- name: Build a binary wheel and a source tarball
run: |
python -m build
- name: Publish distribution 📦 to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist/*
- name: Upload release to github
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
dist/*