Skip to content

fix: Package version list incomplete #287

fix: Package version list incomplete

fix: Package version list incomplete #287

Workflow file for this run

name: Publish
on:
# Tests docker build without pushing
push:
branches:
- main
pull_request:
# Manually, or from another workflow, trigger build of a new version
workflow_call:
inputs:
version:
description: 'SemVer version to create'
required: true
type: string
publish:
description: 'Publish the new version'
required: true
type: boolean
workflow_dispatch:
inputs:
version:
description: "Manually create a new SemVer version, will not create a release or tag, use with caution"
required: true
type: string
publish:
description: 'Publish the new version'
required: false
type: boolean
default: false
concurrency:
# Cancel existing runs when pushing to the same branch of a PR
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
name: Build
timeout-minutes: 15
outputs:
version: ${{ steps.meta.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: docker/metadata-action@v5
name: Docker meta
id: meta
with:
images: |
ghcr.io/allexveldman/pyoci
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=semver,value=${{ inputs.version }},pattern={{version}}
type=semver,value=${{ inputs.version }},pattern={{major}}.{{minor}}
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./
file: docker/Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
push: ${{ inputs.publish || false }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Smoke-test the image
# The smoke test contains a build of the image but because the previous
# step defines `load: true` the entire build will be from cache.
- uses: extractions/setup-just@v2
- uses: snok/install-poetry@v1
- run: just test-smoke
- run: docker compose logs pyoci
working-directory: ./docker