mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-12 13:00:01 -08:00
Compare commits
4 commits
5dc5390880
...
0a9d6b2226
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a9d6b2226 | ||
|
|
885b50de00 | ||
|
|
76bcc4842b | ||
|
|
b858d684cb |
2 changed files with 24 additions and 10 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
.git/
|
|
||||||
build/
|
build/
|
||||||
.github/
|
.github/
|
||||||
.tx/
|
.tx/
|
||||||
|
|
|
||||||
33
.github/workflows/docker-release.yml
vendored
33
.github/workflows/docker-release.yml
vendored
|
|
@ -20,11 +20,22 @@ on:
|
||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- released # publishing of stable releases
|
- released # publishing of stable releases
|
||||||
|
workflow_dispatch: # (re)publish the image for an existing stable release
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: 'Existing release tag to build and publish (e.g. 2026-10-03-Release-3.1.0)'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
latest:
|
||||||
|
description: 'Also update the "latest" tag'
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
|
||||||
# Cancel earlier, unfinished runs of this workflow on the same branch (unless on release)
|
# Cancel earlier, unfinished runs of this workflow on the same branch (unless publishing)
|
||||||
concurrency:
|
concurrency:
|
||||||
group: "${{ github.workflow }} @ ${{ github.ref_name }}"
|
group: "${{ github.workflow }} @ ${{ inputs.tag || github.ref_name }}"
|
||||||
cancel-in-progress: ${{ github.event_name != 'release' }}
|
cancel-in-progress: ${{ github.event_name != 'release' && github.event_name != 'workflow_dispatch' }}
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GHCR_IMAGE: ghcr.io/cockatrice/servatrice
|
GHCR_IMAGE: ghcr.io/cockatrice/servatrice
|
||||||
|
|
@ -57,12 +68,14 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
ref: ${{ case(github.event_name == 'workflow_dispatch', format('refs/tags/{0}', inputs.tag), '') }}
|
||||||
|
|
||||||
- name: "Set up Docker buildx"
|
- name: "Set up Docker buildx"
|
||||||
uses: docker/setup-buildx-action@v4
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
- name: "Login to GitHub Container Registry (GHCR)"
|
- name: "Login to GitHub Container Registry (GHCR)"
|
||||||
if: github.event_name == 'release' && github.event.release.prerelease == false
|
if: (github.event_name == 'release' && github.event.release.prerelease == false) || github.event_name == 'workflow_dispatch'
|
||||||
id: login
|
id: login
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -70,7 +83,7 @@ jobs:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ github.token }}
|
password: ${{ github.token }}
|
||||||
|
|
||||||
# Don't push for non-release triggers
|
# Don't push for non-publishing triggers
|
||||||
- name: "Build image"
|
- name: "Build image"
|
||||||
if: steps.login.outcome != 'success'
|
if: steps.login.outcome != 'success'
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v7
|
||||||
|
|
@ -111,7 +124,6 @@ jobs:
|
||||||
if: steps.login.outcome == 'success'
|
if: steps.login.outcome == 'success'
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
archive: false
|
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
name: digest-${{ matrix.label }}
|
name: digest-${{ matrix.label }}
|
||||||
path: ${{ runner.temp }}/digests/*
|
path: ${{ runner.temp }}/digests/*
|
||||||
|
|
@ -121,7 +133,7 @@ jobs:
|
||||||
# Create an OCI image index from the platform-specific image manifests
|
# Create an OCI image index from the platform-specific image manifests
|
||||||
index:
|
index:
|
||||||
name: "Publish multi-platform Servatrice image"
|
name: "Publish multi-platform Servatrice image"
|
||||||
if: github.repository_owner == 'Cockatrice' && github.event_name == 'release' && github.event.release.prerelease == false
|
if: github.repository_owner == 'Cockatrice' && ((github.event_name == 'release' && github.event.release.prerelease == false) || github.event_name == 'workflow_dispatch')
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-slim # https://github.com/actions/runner-images/blob/main/images/ubuntu-slim/ubuntu-slim-Readme.md
|
runs-on: ubuntu-slim # https://github.com/actions/runner-images/blob/main/images/ubuntu-slim/ubuntu-slim-Readme.md
|
||||||
|
|
||||||
|
|
@ -147,8 +159,11 @@ jobs:
|
||||||
images: ${{ env.GHCR_IMAGE }}
|
images: ${{ env.GHCR_IMAGE }}
|
||||||
flavor: |
|
flavor: |
|
||||||
latest=auto
|
latest=auto
|
||||||
|
# if semver, also: type=semver,pattern={{version}} / {{major}}.{{minor}}
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=tag # if semver, also: type=semver,pattern={{version}} / {{major}}.{{minor}}
|
type=ref,event=tag
|
||||||
|
type=raw,value=${{ inputs.tag }},enable=${{ github.event_name == 'workflow_dispatch' }}
|
||||||
|
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' && inputs.latest }}
|
||||||
|
|
||||||
# Add OCI annotations to image index and publish tags
|
# Add OCI annotations to image index and publish tags
|
||||||
- name: "Create image index"
|
- name: "Create image index"
|
||||||
|
|
@ -176,7 +191,7 @@ jobs:
|
||||||
|
|
||||||
- name: "Inspect images"
|
- name: "Inspect images"
|
||||||
env:
|
env:
|
||||||
GITHUB_TAG: ${{ github.ref_name }}
|
GITHUB_TAG: ${{ inputs.tag || github.ref_name }}
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools inspect "$GHCR_IMAGE:latest"
|
docker buildx imagetools inspect "$GHCR_IMAGE:latest"
|
||||||
docker buildx imagetools inspect "$GHCR_IMAGE:$GITHUB_TAG"
|
docker buildx imagetools inspect "$GHCR_IMAGE:$GITHUB_TAG"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue