Skip to content

v2.2.0

v2.2.0 #11

Workflow file for this run

name: Release
on:
release:
types: [published]
workflow_dispatch:
jobs:
init:
name: 🚩 Initialize
runs-on: ubuntu-latest
steps:
- name: Cancel previous workflow
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
release:
name: Release
needs: init
permissions:
contents: write
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/[email protected]
- name: Get version
run: |
APP_VERSION=${GITHUB_REF##*/}
echo "APP_VERSION=${APP_VERSION:1}" >> $GITHUB_ENV
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache Poetry
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-2.0.3
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: "2.0.3"
virtualenvs-create: true
virtualenvs-in-project: true
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction --no-root
if: steps.cache-deps.outputs.cache-hit != 'true'
- name: Install project
run: poetry install --no-interaction
- name: Test
run: poetry run pytest
- name: Build
run: poetry build
- name: Publish - Github
uses: softprops/action-gh-release@v1
if: ${{ matrix.python-version == '3.10' }}
with:
fail_on_unmatched_files: true
files: |
./dist/check_filter-${{ env.APP_VERSION }}-py3-none-any.whl
./dist/check_filter-${{ env.APP_VERSION }}.tar.gz
- name: Publish - PyPi
uses: JRubics/[email protected]
if: ${{ matrix.python-version == '3.10' }}
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
ignore_dev_requirements: "yes"