Skip to content

v2.1.0

v2.1.0 #10

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.8", "3.9", "3.10", "3.11"]
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- 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@v3
with:
path: ~/.local
key: poetry-1.5-0
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: "1.5.0"
virtualenvs-create: true
virtualenvs-in-project: true
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v3
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"