2025-04-16 18:54:36 +01:00
|
|
|
name: Release Docker Image
|
2025-04-24 17:24:28 +01:00
|
|
|
concurrency:
|
2025-04-17 14:35:16 +01:00
|
|
|
group: "release-image-${{ github.ref }}"
|
2025-04-16 18:54:36 +01:00
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
push:
|
2025-09-06 15:20:45 +01:00
|
|
|
branches:
|
2025-09-06 16:21:21 +01:00
|
|
|
- main
|
2025-04-16 18:54:36 +01:00
|
|
|
paths-ignore:
|
2025-04-24 17:24:28 +01:00
|
|
|
- "*.md"
|
|
|
|
|
- "**/*.md"
|
2026-04-15 06:49:17 +00:00
|
|
|
- "*.mdx"
|
|
|
|
|
- "**/*.mdx"
|
|
|
|
|
- "changelog.d/**"
|
2025-04-24 17:24:28 +01:00
|
|
|
- ".gitlab-ci.yml"
|
|
|
|
|
- ".gitignore"
|
|
|
|
|
- "renovate.json"
|
2025-09-02 12:20:23 -04:00
|
|
|
- "pkg/**"
|
2025-04-24 17:24:28 +01:00
|
|
|
- "docs/**"
|
2025-09-22 16:49:03 +01:00
|
|
|
tags:
|
|
|
|
|
- "v*.*.*"
|
2025-04-16 18:54:36 +01:00
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
|
|
env:
|
2025-04-24 17:24:28 +01:00
|
|
|
BUILTIN_REGISTRY: forgejo.ellis.link
|
|
|
|
|
BUILTIN_REGISTRY_ENABLED: "${{ ((vars.BUILTIN_REGISTRY_USER && secrets.BUILTIN_REGISTRY_PASSWORD) || (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)) && 'true' || 'false' }}"
|
2025-09-13 16:17:28 +01:00
|
|
|
IMAGE_PATH: forgejo.ellis.link/continuwuation/continuwuity
|
2025-04-16 18:54:36 +01:00
|
|
|
|
|
|
|
|
jobs:
|
2025-09-12 10:45:06 +01:00
|
|
|
build-release:
|
|
|
|
|
name: "Build ${{ matrix.slug }} (release)"
|
2025-04-18 14:09:09 +01:00
|
|
|
runs-on: dind
|
2025-04-16 18:54:36 +01:00
|
|
|
permissions:
|
|
|
|
|
contents: read
|
|
|
|
|
packages: write
|
|
|
|
|
attestations: write
|
|
|
|
|
id-token: write
|
|
|
|
|
strategy:
|
2025-04-24 17:24:28 +01:00
|
|
|
matrix:
|
2025-09-11 12:30:19 +01:00
|
|
|
include:
|
|
|
|
|
- platform: "linux/amd64"
|
|
|
|
|
slug: "linux-amd64"
|
|
|
|
|
- platform: "linux/arm64"
|
|
|
|
|
slug: "linux-arm64"
|
2025-06-20 21:48:37 +01:00
|
|
|
|
2025-04-16 18:54:36 +01:00
|
|
|
steps:
|
2025-05-01 00:47:03 +01:00
|
|
|
- name: Checkout repository
|
2026-04-13 05:22:53 +00:00
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
2025-05-01 00:47:03 +01:00
|
|
|
with:
|
|
|
|
|
persist-credentials: false
|
2025-09-12 10:45:06 +01:00
|
|
|
- name: Prepare Docker build environment
|
|
|
|
|
id: prepare
|
|
|
|
|
uses: ./.forgejo/actions/prepare-docker-build
|
|
|
|
|
with:
|
|
|
|
|
platform: ${{ matrix.platform }}
|
|
|
|
|
slug: ${{ matrix.slug }}
|
|
|
|
|
target_cpu: ""
|
|
|
|
|
profile: "release"
|
2025-09-13 16:17:28 +01:00
|
|
|
images: ${{ env.IMAGE_PATH }}
|
2025-09-12 10:45:06 +01:00
|
|
|
registry_user: ${{ vars.BUILTIN_REGISTRY_USER || github.actor }}
|
|
|
|
|
registry_password: ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}
|
2025-04-16 18:54:36 +01:00
|
|
|
- name: Build and push Docker image by digest
|
|
|
|
|
id: build
|
2026-05-26 05:18:06 +00:00
|
|
|
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7
|
2025-04-16 18:54:36 +01:00
|
|
|
with:
|
|
|
|
|
context: .
|
|
|
|
|
file: "docker/Dockerfile"
|
|
|
|
|
build-args: |
|
2025-09-07 13:21:58 +01:00
|
|
|
GIT_COMMIT_HASH=${{ github.sha }}
|
2025-06-13 14:29:14 +01:00
|
|
|
GIT_COMMIT_HASH_SHORT=${{ env.COMMIT_SHORT_SHA }}
|
2025-05-01 00:38:35 +01:00
|
|
|
GIT_REMOTE_URL=${{github.event.repository.html_url }}
|
|
|
|
|
GIT_REMOTE_COMMIT_URL=${{github.event.head_commit.url }}
|
2025-09-08 04:32:23 +01:00
|
|
|
CARGO_INCREMENTAL=${{ env.BUILDKIT_ENDPOINT != '' && '1' || '0' }}
|
2025-09-12 10:45:06 +01:00
|
|
|
TARGET_CPU=
|
|
|
|
|
RUST_PROFILE=release
|
2025-04-16 18:54:36 +01:00
|
|
|
platforms: ${{ matrix.platform }}
|
2025-09-12 10:45:06 +01:00
|
|
|
labels: ${{ steps.prepare.outputs.metadata_labels }}
|
|
|
|
|
annotations: ${{ steps.prepare.outputs.metadata_annotations }}
|
2025-04-18 21:05:17 +01:00
|
|
|
cache-from: type=gha
|
2025-05-26 19:16:50 +01:00
|
|
|
# cache-to: type=gha,mode=max
|
2025-04-16 18:54:36 +01:00
|
|
|
sbom: true
|
2025-09-07 20:06:39 +01:00
|
|
|
outputs: |
|
2025-09-13 16:17:28 +01:00
|
|
|
${{ env.BUILTIN_REGISTRY_ENABLED == 'true' && format('type=image,"name={0}",push-by-digest=true,name-canonical=true,push=true', env.IMAGE_PATH) || format('type=image,"name={0}",push=false', env.IMAGE_PATH) }}
|
2025-09-07 20:06:39 +01:00
|
|
|
type=local,dest=/tmp/binaries
|
2025-04-16 18:54:36 +01:00
|
|
|
env:
|
|
|
|
|
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
|
2025-09-12 10:45:06 +01:00
|
|
|
- name: Upload Docker artifacts
|
|
|
|
|
uses: ./.forgejo/actions/upload-docker-artifacts
|
2025-07-06 22:18:51 +01:00
|
|
|
with:
|
2025-09-12 10:45:06 +01:00
|
|
|
slug: ${{ matrix.slug }}
|
|
|
|
|
cpu_suffix: ${{ steps.prepare.outputs.cpu_suffix }}
|
|
|
|
|
artifact_suffix: ""
|
|
|
|
|
digest_suffix: ""
|
|
|
|
|
digest: ${{ steps.build.outputs.digest }}
|
2025-07-06 22:18:51 +01:00
|
|
|
|
2025-09-12 10:45:06 +01:00
|
|
|
merge-release:
|
|
|
|
|
name: "Create Multi-arch Release Manifest"
|
|
|
|
|
runs-on: dind
|
2025-09-13 16:17:28 +01:00
|
|
|
needs: build-release
|
2025-09-12 10:45:06 +01:00
|
|
|
steps:
|
|
|
|
|
- name: Checkout repository
|
2026-04-13 05:22:53 +00:00
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
2025-09-12 10:45:06 +01:00
|
|
|
with:
|
|
|
|
|
persist-credentials: false
|
|
|
|
|
- name: Create multi-platform manifest
|
|
|
|
|
uses: ./.forgejo/actions/create-docker-manifest
|
2025-04-16 18:54:36 +01:00
|
|
|
with:
|
2025-09-12 10:45:06 +01:00
|
|
|
digest_pattern: "digests-linux-{amd64,arm64}"
|
|
|
|
|
tag_suffix: ""
|
2025-09-13 16:17:28 +01:00
|
|
|
images: ${{ env.IMAGE_PATH }}
|
2025-09-12 10:45:06 +01:00
|
|
|
registry_user: ${{ vars.BUILTIN_REGISTRY_USER || github.actor }}
|
|
|
|
|
registry_password: ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}
|
2025-04-24 17:24:28 +01:00
|
|
|
|
2025-09-12 10:45:06 +01:00
|
|
|
build-maxperf:
|
|
|
|
|
name: "Build ${{ matrix.slug }} (max-perf)"
|
2025-04-18 14:09:09 +01:00
|
|
|
runs-on: dind
|
2025-09-13 16:17:28 +01:00
|
|
|
needs: build-release
|
2025-09-12 10:45:06 +01:00
|
|
|
permissions:
|
|
|
|
|
contents: read
|
|
|
|
|
packages: write
|
|
|
|
|
attestations: write
|
|
|
|
|
id-token: write
|
2025-09-11 12:30:19 +01:00
|
|
|
strategy:
|
|
|
|
|
matrix:
|
|
|
|
|
include:
|
2025-09-12 10:45:06 +01:00
|
|
|
- platform: "linux/amd64"
|
|
|
|
|
slug: "linux-amd64"
|
|
|
|
|
target_cpu: "haswell"
|
|
|
|
|
- platform: "linux/arm64"
|
|
|
|
|
slug: "linux-arm64"
|
|
|
|
|
target_cpu: ""
|
|
|
|
|
|
2025-04-16 18:54:36 +01:00
|
|
|
steps:
|
2025-09-12 10:45:06 +01:00
|
|
|
- name: Checkout repository
|
2026-04-13 05:22:53 +00:00
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
2025-04-16 18:54:36 +01:00
|
|
|
with:
|
2025-09-12 10:45:06 +01:00
|
|
|
persist-credentials: false
|
|
|
|
|
- name: Prepare max-perf Docker build environment
|
|
|
|
|
id: prepare
|
|
|
|
|
uses: ./.forgejo/actions/prepare-docker-build
|
|
|
|
|
with:
|
|
|
|
|
platform: ${{ matrix.platform }}
|
|
|
|
|
slug: ${{ matrix.slug }}
|
|
|
|
|
target_cpu: ${{ matrix.target_cpu }}
|
|
|
|
|
profile: "release-max-perf"
|
2025-09-13 16:17:28 +01:00
|
|
|
images: ${{ env.IMAGE_PATH }}
|
2025-09-12 10:45:06 +01:00
|
|
|
registry_user: ${{ vars.BUILTIN_REGISTRY_USER || github.actor }}
|
|
|
|
|
registry_password: ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}
|
|
|
|
|
- name: Build and push max-perf Docker image by digest
|
|
|
|
|
id: build
|
2026-05-26 05:18:06 +00:00
|
|
|
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7
|
2025-04-16 18:54:36 +01:00
|
|
|
with:
|
2025-09-12 10:45:06 +01:00
|
|
|
context: .
|
|
|
|
|
file: "docker/Dockerfile"
|
|
|
|
|
build-args: |
|
|
|
|
|
GIT_COMMIT_HASH=${{ github.sha }}
|
|
|
|
|
GIT_COMMIT_HASH_SHORT=${{ env.COMMIT_SHORT_SHA }}
|
|
|
|
|
GIT_REMOTE_URL=${{github.event.repository.html_url }}
|
|
|
|
|
GIT_REMOTE_COMMIT_URL=${{github.event.head_commit.url }}
|
|
|
|
|
CARGO_INCREMENTAL=${{ env.BUILDKIT_ENDPOINT != '' && '1' || '0' }}
|
|
|
|
|
TARGET_CPU=${{ matrix.target_cpu }}
|
|
|
|
|
RUST_PROFILE=release-max-perf
|
|
|
|
|
platforms: ${{ matrix.platform }}
|
|
|
|
|
labels: ${{ steps.prepare.outputs.metadata_labels }}
|
|
|
|
|
annotations: ${{ steps.prepare.outputs.metadata_annotations }}
|
|
|
|
|
cache-from: type=gha
|
|
|
|
|
# cache-to: type=gha,mode=max
|
|
|
|
|
sbom: true
|
|
|
|
|
outputs: |
|
2025-09-13 16:17:28 +01:00
|
|
|
${{ env.BUILTIN_REGISTRY_ENABLED == 'true' && format('type=image,"name={0}",push-by-digest=true,name-canonical=true,push=true', env.IMAGE_PATH) || format('type=image,"name={0}",push=false', env.IMAGE_PATH) }}
|
2025-09-12 10:45:06 +01:00
|
|
|
type=local,dest=/tmp/binaries
|
|
|
|
|
env:
|
|
|
|
|
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
|
|
|
|
|
- name: Upload max-perf Docker artifacts
|
|
|
|
|
uses: ./.forgejo/actions/upload-docker-artifacts
|
2025-09-06 15:55:24 +01:00
|
|
|
with:
|
2025-09-12 10:45:06 +01:00
|
|
|
slug: ${{ matrix.slug }}
|
|
|
|
|
cpu_suffix: ${{ steps.prepare.outputs.cpu_suffix }}
|
|
|
|
|
artifact_suffix: "-maxperf"
|
|
|
|
|
digest_suffix: "-maxperf"
|
|
|
|
|
digest: ${{ steps.build.outputs.digest }}
|
2025-04-16 18:54:36 +01:00
|
|
|
|
2025-09-12 10:45:06 +01:00
|
|
|
merge-maxperf:
|
|
|
|
|
name: "Create Max-Perf Manifest"
|
|
|
|
|
runs-on: dind
|
2025-09-13 16:17:28 +01:00
|
|
|
needs: build-maxperf
|
2025-09-12 10:45:06 +01:00
|
|
|
steps:
|
|
|
|
|
- name: Checkout repository
|
2026-04-13 05:22:53 +00:00
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
2025-04-16 18:54:36 +01:00
|
|
|
with:
|
2025-09-12 10:45:06 +01:00
|
|
|
persist-credentials: false
|
|
|
|
|
- name: Create max-perf manifest
|
|
|
|
|
uses: ./.forgejo/actions/create-docker-manifest
|
|
|
|
|
with:
|
|
|
|
|
digest_pattern: "digests-maxperf-linux-{amd64-haswell,arm64}"
|
|
|
|
|
tag_suffix: "-maxperf"
|
2025-09-13 16:17:28 +01:00
|
|
|
images: ${{ env.IMAGE_PATH }}
|
2025-09-12 10:45:06 +01:00
|
|
|
registry_user: ${{ vars.BUILTIN_REGISTRY_USER || github.actor }}
|
|
|
|
|
registry_password: ${{ secrets.BUILTIN_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}
|
2026-04-14 22:26:23 +02:00
|
|
|
|
2026-04-25 11:17:43 +01:00
|
|
|
release-binaries:
|
|
|
|
|
name: "Release Binaries"
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
needs:
|
|
|
|
|
- build-release
|
|
|
|
|
- build-maxperf
|
|
|
|
|
permissions:
|
|
|
|
|
contents: write
|
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
|
steps:
|
|
|
|
|
- name: Download binary artifacts
|
|
|
|
|
uses: forgejo/download-artifact@v4
|
|
|
|
|
with:
|
|
|
|
|
pattern: conduwuit*
|
|
|
|
|
path: binaries
|
|
|
|
|
merge-multiple: true
|
|
|
|
|
- name: Create Release and Upload
|
2026-05-01 17:50:20 +00:00
|
|
|
uses: https://github.com/softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3
|
2026-04-25 11:17:43 +01:00
|
|
|
with:
|
|
|
|
|
draft: true
|
|
|
|
|
files: binaries/*
|
|
|
|
|
|
2026-04-14 22:26:23 +02:00
|
|
|
mirror_images:
|
2026-04-15 06:01:45 +02:00
|
|
|
name: "Mirror Images"
|
|
|
|
|
runs-on: ubuntu-latest
|
2026-04-14 22:26:23 +02:00
|
|
|
needs:
|
|
|
|
|
- merge-maxperf
|
|
|
|
|
- merge-release
|
2026-04-16 14:29:42 +00:00
|
|
|
secrets: inherit
|
2026-04-14 22:26:23 +02:00
|
|
|
uses: ./.forgejo/workflows/mirror-images.yml
|