Skip to content

Commit

Permalink
feat: release automation (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogrodnek authored Sep 8, 2024
1 parent e7eb2cd commit 60ca2ae
Show file tree
Hide file tree
Showing 5 changed files with 725 additions and 411 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/check_pr_title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Lint PR"

on:
pull_request:
types:
- opened
- edited
- synchronize
- reopened

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release

on:
push:
branches:
- release_automate

jobs:
release:
environment: release
name: Release to PyPI
concurrency: release
permissions:
contents: write
id-token: write

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-release-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install project
run: poetry install --no-interaction

- name: Semantic release
run: |
poetry run semantic-release version
poetry run semantic-release publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: build
run: poetry install && poetry build

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Loading

0 comments on commit 60ca2ae

Please sign in to comment.