Skip to content

Commit

Permalink
Add publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
monoxgas committed Jan 31, 2024
1 parent 7738a8c commit f561629
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Publish

on:
push:
branches: [ main ]

jobs:
build-and-publish:
environment: protected
permissions:
contents: read
id-token: write

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Setup Poetry
uses: abatilo/actions-poetry@v2

- name: Configure local .venv
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Cache Dependencies
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}

- name: Install dependencies
run: poetry install

- name: Build package
run: poetry build

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

0 comments on commit f561629

Please sign in to comment.