You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spiel/.github/workflows/publish-package.yml

54 lines
1.5 KiB
YAML

name: publish-package
on:
release:
types: [published]
jobs:
pypi:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3.5.3
- name: Set up Python 3.x
uses: actions/setup-python@v4.6.1
with:
python-version: "3.x"
- name: Install Poetry
uses: snok/install-poetry@v1.3.4
- name: Build the package
run: poetry build -vvv
- name: Publish to PyPI
run: poetry publish --username __token__ --password ${{ secrets.pypi_token }}
working-directory: ${{ github.workspace }}
ghcr:
runs-on: ubuntu-latest
steps:
- name: Set meta info
id: set-meta
run: |
echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
echo "repo=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.0.0
with:
install: true
- name: Log in to GHCR
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Image and Push to GHCR
uses: docker/build-push-action@v4.1.1
with:
file: ./docker/Dockerfile
pull: true
push: true
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
tags: |
ghcr.io/${{ steps.set-meta.outputs.repo }}:latest
ghcr.io/${{ steps.set-meta.outputs.repo }}:${{ steps.set-meta.outputs.tag }}