Skip to content

Commit cc6495f

Browse files
#40: Added pypi release workflow (#43)
1 parent 81abae7 commit cc6495f

File tree

3 files changed

+70
-11
lines changed

3 files changed

+70
-11
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: 'Prepare Poetry environment'
2+
description: 'This composite actions checks out out the project, installs Poetry, and install the project in the Poetry environment'
3+
inputs:
4+
python-version:
5+
description: 'The Python version to use'
6+
required: true
7+
default: '3.8'
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- uses: actions/setup-python@v2
13+
with:
14+
python-version: ${{ matrix.python-version }}
15+
- name: Install Poetry
16+
uses: abatilo/actions-poetry@v2.1.4
17+
with:
18+
poetry-version: 1.4.0
19+
- name: Poetry install
20+
run: poetry install
21+
shell: bash

.github/workflows/pypi_release.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build & Publish
2+
3+
on:
4+
push:
5+
tags: '**'
6+
7+
workflow_dispatch:
8+
9+
jobs:
10+
11+
cd-job:
12+
name: Continues Delivery
13+
runs-on: ubuntu-latest
14+
steps:
15+
16+
- name: SCM Checkout
17+
uses: actions/checkout@v3
18+
19+
- name: Setup Python & Poetry Environment
20+
uses: ./.github/actions/prepare_poetry_env
21+
22+
- name: Build Artifacts
23+
run: poetry build
24+
25+
- name: PyPi Release
26+
env:
27+
POETRY_HTTP_BASIC_PYPI_USERNAME: "__token__"
28+
POETRY_HTTP_BASIC_PYPI_PASSWORD: "${{ secrets.PYPI_TOKEN }}"
29+
run: poetry publish
30+
31+
- name: GitHub Release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run: >
35+
gh release create ${GITHUB_REF_NAME}
36+
--title ${GITHUB_REF_NAME} -F "./doc/changes/changes_${GITHUB_REF_NAME}.md"
37+
dist/*

.github/workflows/pytest.yaml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Run pytest
22

3-
on: [push, pull_request]
3+
on: [push]
44

55
jobs:
66
pytest:
@@ -11,13 +11,14 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-python@v2
16-
with:
17-
python-version: ${{ matrix.python-version }}
18-
- name: Install Poetry
19-
uses: abatilo/actions-poetry@v2.1.4
20-
- name: Install dependencies
21-
run: poetry install
22-
- name: Run pytest
23-
run: poetry run python3 -m pytest
14+
15+
- name: SCM Checkout
16+
uses: actions/checkout@v3
17+
18+
- name: Setup Python & Poetry Environment
19+
uses: ./.github/actions/prepare_poetry_env
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Run pytest
24+
run: poetry run python3 -m pytest

0 commit comments

Comments
 (0)