Skip to content

Merge pull request #15 from TheCleric/update/python_versions_mac #23

Merge pull request #15 from TheCleric/update/python_versions_mac

Merge pull request #15 from TheCleric/update/python_versions_mac #23

Workflow file for this run

name: Release
on:
push:
branches:
- master
tags:
- "*.*.*"
jobs:
Release:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get tag
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Set up Python 3.6
uses: actions/setup-python@v5
with:
python-version: "3.6"
- name: Setup poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.1.10"
- name: Update PATH
shell: bash
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Configure poetry
shell: bash
run: poetry config virtualenvs.in-project true
- name: Poetry check & build
shell: bash
run: poetry check && poetry build
- name: Install dependencies
shell: bash
run: poetry install
- name: PyTest
shell: bash
run: poetry run pytest
- name: Mypy
shell: bash
run: poetry run mypy .
- name: Check Version
id: check-version
shell: bash
run: |
[[ "$(poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] \
|| echo "prerelease=true" >> $GITHUB_OUTPUT
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: steps.check-version.outputs.prerelease == 'true'
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
shell: bash
run: poetry publish