Skip to content

workflow: Set prerelease bool #82

workflow: Set prerelease bool

workflow: Set prerelease bool #82

Workflow file for this run

name: Build
on: push
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
runs-on: ${{ matrix.os }}
steps:
#----------------------------------------------
# check-out repo and set-up python and poetry
#----------------------------------------------
- name: Checkout
uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Setup Python 3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install project
run: poetry install --no-interaction
- name: Run tests
run: poetry run python -m unittest
build:
needs: test
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
#----------------------------------------------
# check-out repo and set-up python and poetry
#----------------------------------------------
- name: Checkout
uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Setup Python 3
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'poetry'
- name: Build
run: poetry build --ansi --no-interaction
- uses: actions/upload-artifact@v2
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
name: dist
path: dist
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Setup Python 3
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'poetry'
- uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Generate Changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@v3
with:
owner: iamkroot
ignorePreReleases: true
commitMode: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release(github)
if: ${{ ! env.ACT }}
uses: softprops/action-gh-release@v2
with:
files: dist/*.*
body: ${{steps.github_release.outputs.changelog}}
prerelease: ${{ contains(github.ref, '-beta') }}
- name: Release(pypi)
run: poetry publish --ansi --no-interaction
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
# vim:ft=yaml:ts=2:et: