Skip to content

Commit 6c98890

Browse files
authored
Unify workflows (#38)
1 parent 8bea36d commit 6c98890

2 files changed

Lines changed: 45 additions & 54 deletions

File tree

.github/workflows/ci.yml

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
name: CI
22

33
on:
4-
pull_request:
5-
push:
6-
branches:
4+
- push
5+
- pull_request
76

87
jobs:
9-
ci:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-python@v2
13+
- uses: pre-commit/action@v2.0.0
14+
15+
test:
1016
runs-on: ubuntu-latest
1117
strategy:
1218
fail-fast: false
@@ -24,21 +30,14 @@ jobs:
2430
# actions/checkout#249
2531
fetch-depth: 0
2632

27-
- name: Set up Python ${{ matrix.python-version }}
28-
uses: actions/setup-python@v2
33+
- uses: actions/setup-python@v2
2934
with:
3035
python-version: ${{ matrix.python-version }}
3136

3237
- name: Ensure pip is up to date
3338
run: |
3439
python -m pip install --upgrade pip
3540
36-
- name: Lint
37-
run: |
38-
python -m pip install pre-commit
39-
pre-commit run --all-files
40-
if: matrix.python-version == '3.8'
41-
4241
- name: Test
4342
run: |
4443
python -m pip install tox
@@ -47,3 +46,37 @@ jobs:
4746
- uses: codecov/codecov-action@v1
4847
with:
4948
fail_ci_if_error: true
49+
50+
release:
51+
needs:
52+
- lint
53+
- test
54+
runs-on: ubuntu-latest
55+
if: startsWith(github.ref, 'refs/tags/v')
56+
steps:
57+
- uses: actions/checkout@v2
58+
- uses: actions/setup-python@v2
59+
60+
- name: Ensure pip is up to date
61+
run: |
62+
python -m pip install --upgrade pip
63+
64+
- name: Build
65+
run: |
66+
python -m pip install pep517
67+
python -m pep517.build .
68+
69+
- name: Publish
70+
env:
71+
TWINE_USERNAME: __token__
72+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
73+
run: |
74+
python -m pip install twine
75+
twine upload dist/*
76+
77+
- uses: actions/create-release@v1
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
with:
81+
tag_name: ${{ github.ref }}
82+
release_name: ${{ github.ref }}

.github/workflows/release.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)