Skip to content

Commit 55ce932

Browse files
committed
chore: use org ci and publish pipelines
1 parent 002768e commit 55ce932

File tree

2 files changed

+15
-124
lines changed

2 files changed

+15
-124
lines changed

.github/workflows/pypi-publish.yml

Lines changed: 10 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Bump, Release, and Publish
1+
name: Bump, Publish, and Release
22

33
on:
44
workflow_dispatch:
@@ -19,74 +19,13 @@ on:
1919
default: false
2020
type: boolean
2121

22-
concurrency:
23-
group: tag-and-release
24-
cancel-in-progress: true
25-
2622
jobs:
27-
deploy:
28-
runs-on: ubuntu-latest
29-
steps:
30-
- uses: actions/checkout@v3
31-
with:
32-
persist-credentials: false
33-
fetch-depth: 0
34-
submodules: true
35-
- name: Set up Python
36-
uses: actions/setup-python@v4
37-
- name: Install Poetry
38-
uses: snok/install-poetry@v1
39-
with:
40-
virtualenvs-create: true
41-
virtualenvs-in-project: true
42-
installer-parallel: true
43-
- name: Bump Version
44-
run: poetry version ${{ github.event.inputs.newversion }}
45-
- name: Get New Version
46-
id: get-new-version
47-
run: |
48-
echo "version=$(poetry version -s)" >> $GITHUB_OUTPUT
49-
- name: Install dependencies
50-
run: poetry install --with dev --no-interaction --no-root
51-
- name: Install project
52-
run: poetry install --with dev --no-interaction
53-
- name: Run tests
54-
run: |
55-
source .venv/bin/activate
56-
pytest tests/
57-
- name: Poetry Build
58-
run: |
59-
poetry build
60-
- name: Poetry Publish to PyPi Test
61-
if: ${{ 'true' == github.event.inputs.testpublish }}
62-
run: |
63-
poetry config repositories.testpypi https://test.pypi.org/legacy/
64-
poetry publish --repository testpypi --no-interaction --skip-existing
65-
env:
66-
POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TEST_PYPI_API_TOKEN }}
67-
- name: Poetry Publish to PyPi
68-
run: |
69-
poetry publish --no-interaction
70-
env:
71-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
72-
- name: Commit & Push changes
73-
uses: actions-js/[email protected]
74-
with:
75-
author_email: [email protected]
76-
author_name: ${{ github.actor }}
77-
message:
78-
"[skip ci] bumped to ${{ steps.get-new-version.outputs.version }}"
79-
github_token: ${{ secrets.VERSION_BUMP_TAG_TOKEN }}
80-
- name: Tag version
81-
id: tag-version
82-
uses: mathieudutour/[email protected]
83-
with:
84-
custom_tag: ${{ steps.get-new-version.outputs.version }}
85-
create_annotated_tag: true
86-
github_token: ${{ secrets.VERSION_BUMP_TAG_TOKEN }}
87-
- name: Create a GitHub release
88-
uses: ncipollo/release-action@v1
89-
with:
90-
tag: ${{ steps.tag-version.outputs.new_tag }}
91-
name: ${{ steps.tag-version.outputs.new_tag }}
92-
body: ${{ steps.tag-version.outputs.changelog }}
23+
publish:
24+
uses: prosegrinder/.github/.github/workflows/python-poetry-publish.yaml@main
25+
with:
26+
newversion: ${{ github.event.inputs.newversion }}
27+
testpublish: ${{ 'true' == github.event.inputs.testpublish }}
28+
secrets:
29+
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
30+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
31+
VERSION_BUMP_TAG_TOKEN: ${{ secrets.VERSION_BUMP_TAG_TOKEN }}

.github/workflows/python-ci.yml

Lines changed: 5 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,12 @@
1-
name: Python CI
1+
name: Python Poetry CI
22

3-
on: pull_request
3+
on:
4+
pull_request:
45

56
concurrency:
67
group: ci-${{ github.ref }}
78
cancel-in-progress: true
89

910
jobs:
10-
lint:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Check Out
14-
uses: actions/checkout@v3
15-
with:
16-
submodules: true
17-
- name: Setup Python
18-
uses: actions/setup-python@v4
19-
- name: Load pip cache
20-
uses: actions/cache@v3
21-
with:
22-
path: ~/.cache/pip
23-
key: ${{ runner.os }}-pip
24-
restore-keys: ${{ runner.os }}-pip
25-
- name: Install linters
26-
run: python -m pip install --upgrade black pylint
27-
- name: Black
28-
run: black . --check
29-
- name: Pylint
30-
run: pylint src/**/*.py
31-
32-
test:
33-
needs: lint
34-
runs-on: ubuntu-latest
35-
strategy:
36-
fail-fast: false
37-
matrix:
38-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
39-
steps:
40-
- uses: actions/checkout@v3
41-
with:
42-
submodules: true
43-
- name: Set up Python ${{ matrix.python-version }}
44-
uses: actions/setup-python@v4
45-
with:
46-
python-version: ${{ matrix.python-version }}
47-
- name: Install Poetry
48-
uses: snok/install-poetry@v1
49-
with:
50-
virtualenvs-create: true
51-
virtualenvs-in-project: true
52-
installer-parallel: true
53-
- name: Install dependencies
54-
run: poetry install --with dev --no-interaction --no-root
55-
- name: Install project
56-
run: poetry install --with dev --no-interaction
57-
- name: Run tests
58-
run: |
59-
source .venv/bin/activate
60-
pytest tests/
11+
python-poetry-ci:
12+
uses: prosegrinder/.github/.github/workflows/python-poetry-ci.yaml@main

0 commit comments

Comments
 (0)