Skip to content

Commit

Permalink
Merge pull request #14 from AstarVienna/fh/releaseworkflow
Browse files Browse the repository at this point in the history
Cleanup release workflow, add experimental version bump workflow
  • Loading branch information
teutoburg authored Nov 16, 2023
2 parents caeb1ed + 5531ddf commit a7f7fee
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 20 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Bump package version
on:
workflow_dispatch:
inputs:
rule:
type: choice
description: Version bump level
options:
- major
- minor
- patch
- premajor
- preminor
- prepatch
- prerelease
- "prerelease --next-phase"

jobs:
bump:
name: Bump version number
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.7.0"

- name: Store current Version
id: current-version
run: |
echo "CURRENT_VERSION=$(poetry version --short)" >> $GITHUB_OUTPUT
- name: Bump package Version using Poetry
run: echo steps.current-version.outputs.CURRENT_VERSION
# run: poetry version ${{ github.event.inputs.rule }}
37 changes: 17 additions & 20 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,27 @@ on:
- published

jobs:
build:
strategy:
fail-fast: false # TODO: do we need this here?
matrix:
# TODO: why do we need matrix here, if we do at all?
# os: [ubuntu-latest, macos-latest, windows-latest]
# python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest]
python-version: ["3.11"]
poetry-version: ["1.7.0"]
runs-on: ${{ matrix.os }}
release:
name: Build and publish package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run image
python-version: "3.11"

- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Publish
poetry-version: "1.7.0"

- name: Build project for distribution
run: poetry build

- name: Publish to PyPI
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish

0 comments on commit a7f7fee

Please sign in to comment.