Skip to content

Commit 373f4ca

Browse files
author
Joel Collins
committed
Add Publish stage to Actions
1 parent 8f212fc commit 373f4ca

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

.github/workflows/publish.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
with:
13+
fetch-depth: 1
14+
15+
- name: Set up Python 3.7
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: 3.7
19+
20+
- name: Install Poetry
21+
uses: dschep/install-poetry-action@v1.3
22+
23+
- name: Cache Poetry virtualenv
24+
uses: actions/cache@v1
25+
id: cache
26+
with:
27+
path: ~/.virtualenvs
28+
key: poetry-${{ hashFiles('**/poetry.lock') }}
29+
restore-keys: |
30+
poetry-${{ hashFiles('**/poetry.lock') }}
31+
32+
- name: Set Poetry config
33+
env:
34+
POETRY_PYPI_TOKEN_PYPI: ${{ POETRY_PYPI_TOKEN_PYPI }}
35+
run: |
36+
poetry config virtualenvs.in-project false
37+
poetry config virtualenvs.path ~/.virtualenvs
38+
poetry config pypi-token.pypi "$POETRY_PYPI_TOKEN_PYPI"
39+
40+
- name: Install Dependencies
41+
run: poetry install
42+
if: steps.cache.outputs.cache-hit != 'true'
43+
44+
- name: Build with Poetry
45+
run: poetry build
46+
47+
- name: Publish with Poetry
48+
run: poetry publish

.github/workflows/ci.yml renamed to .github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: Test
22

33
on: [push]
44

0 commit comments

Comments
 (0)