Skip to content

Commit

Permalink
added pypi release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MarleneKress79789 committed Nov 20, 2023
1 parent 81abae7 commit b9dd291
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 10 deletions.
20 changes: 20 additions & 0 deletions .github/actions/prepare_poetry_env/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Prepare Poetry environment'
description: 'This composite actions checks out out the project, installs Poetry, and install the project in the Poetry environment'
inputs:
python-version:
description: 'The Python version to use'
required: true
default: '3.8'

runs:
using: "composite"
steps:
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: abatilo/actions-poetry@v2.1.4
with:
poetry-version: 1.4.0
- name: Install dependencies
run: poetry install
37 changes: 37 additions & 0 deletions .github/workflows/pypi_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build & Publish

on:
push:
tags: '**'

workflow_dispatch:

jobs:

cd-job:
name: Continues Delivery
runs-on: ubuntu-latest
steps:

- name: SCM Checkout
uses: actions/checkout@v3

- name: Setup Python & Poetry Environment
uses: ./.github/actions/prepare_poetry_env

- name: Build Artifacts
run: poetry build

- name: PyPi Release
env:
POETRY_HTTP_BASIC_PYPI_USERNAME: "__token__"
POETRY_HTTP_BASIC_PYPI_PASSWORD: "${{ secrets.PYPI_TOKEN }}"
run: poetry publish

- name: GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >
gh release create ${GITHUB_REF_NAME}
--title ${GITHUB_REF_NAME} -F "./doc/changes/changes_${GITHUB_REF_NAME}.md"
dist/*
15 changes: 5 additions & 10 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: abatilo/actions-poetry@v2.1.4
- name: Install dependencies
run: poetry install
- name: Run pytest
run: poetry run python3 -m pytest
- uses: actions/checkout@v2
- name: Setup Python & Poetry Environment
uses: ./.github/actions/prepare_poetry_env
- name: Run pytest
run: poetry run python3 -m pytest

0 comments on commit b9dd291

Please sign in to comment.