Skip to content

Commit 8a65969

Browse files
committed
build: github action for publishing
1 parent 392eccb commit 8a65969

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/publish.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: [3.8, 3.9]
13+
fail-fast: false
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install Task
23+
uses: arduino/setup-task@v1
24+
25+
- name: Install Poetry
26+
uses: snok/install-poetry@v1
27+
with:
28+
virtualenvs-create: true
29+
virtualenvs-in-project: true
30+
31+
- name: Load cached venv
32+
id: cached-poetry-dependencies
33+
uses: actions/cache@v2
34+
with:
35+
path: .venv
36+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
37+
38+
- name: Install dependencies
39+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
40+
run: poetry install --no-interaction --no-root
41+
42+
- name: Install library
43+
run: poetry install --no-interaction
44+
45+
- name: Run CI
46+
run: task ci
47+
48+
- name: Build wheels
49+
run: |
50+
poetry version $(git tag --points-at HEAD)
51+
poetry build
52+
53+
- name: Upload
54+
env:
55+
USERNAME: __token__
56+
PASSWORD: ${{ secrets.PYPI_TOKEN }}
57+
run: |
58+
poetry publish --username=$USERNAME --password=$PASSWORD

0 commit comments

Comments
 (0)