Skip to content

Merge pull request #133 from okp4/dependabot/pip/pytest-7.4.4 #163

Merge pull request #133 from okp4/dependabot/pip/pytest-7.4.4

Merge pull request #133 from okp4/dependabot/pip/pytest-7.4.4 #163

Workflow file for this run

name: Publish
on:
push:
branches: [ main ]
tags: [ 'v*' ]
concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: true
jobs:
publish-docker-images:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up context
id: project_context
uses: FranzDiebold/[email protected]
- name: Extract metadata (tags, labels) for Docker
id: docker_metadata
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }},value=${{ env.CI_ACTION_REF_NAME_SLUG }}
type=raw,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }},value=nightly
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
labels: |
org.opencontainers.image.vendor=OKP4
- name: Login to Docker registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
- name: Build and publish image(s)
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.docker_metadata.outputs.tags }}
labels: ${{ steps.docker_metadata.outputs.labels }}
publish-pypi:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up context
id: project_context
uses: FranzDiebold/[email protected]
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install Python Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.3.1
- name: Publish package
working-directory: ${{env.WORK_DIR}}
run: |
poetry install
poetry build
echo "🚀 Publishing pypi package"
poetry publish -u __token__ -p "${{ secrets.PYPI_API_TOKEN }}"