Skip to content

Commit

Permalink
Automate releases (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaomidi authored Mar 3, 2023
1 parent d05b0e1 commit f891e26
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,46 @@
name: Release

on:
release:
types:
- "published"
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- 'main'

jobs:
pypi:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

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

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-in-project: true

- name: Install dependencies
run: poetry install --no-interaction --no-ansi

- name: Build package
run: poetry build

- name: Publish package
if: github.event_name == 'release'
env:
PYPI_USERNAME: __token__
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --build -u "${PYPI_USERNAME}" -p "${PYPI_TOKEN}"

docker:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -42,7 +72,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event_name == 'release' }}
provenance: false
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
Expand Down

0 comments on commit f891e26

Please sign in to comment.