Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Release

on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
inputs:
tag:
description: "Existing tag to build and release (e.g. v0.6.0)"
required: true

permissions:
contents: write # create the GitHub Release
packages: write # push the image to GHCR

jobs:
release:
name: Build and publish Docker image
runs-on: ubuntu-latest

steps:
- name: Resolve release ref
id: ref
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "ref=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT"
else
echo "ref=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
fi

- name: Checkout
uses: actions/checkout@v7
with:
ref: ${{ steps.ref.outputs.ref }}
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern=v{{version}},value=${{ steps.ref.outputs.ref }}
type=semver,pattern={{major}}.{{minor}},value=${{ steps.ref.outputs.ref }}
type=raw,value=latest

- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Extract release notes from CHANGELOG
id: notes
run: |
version="${{ steps.ref.outputs.ref }}"
version="${version#v}"
awk -v ver="$version" '
$0 ~ "^## \\[" ver "\\]" { flag = 1; next }
flag && /^## \[/ { flag = 0 }
flag { print }
' CHANGELOG.md > release_notes.md
if [ ! -s release_notes.md ]; then
printf 'Release %s\n' "$version" > release_notes.md
fi
{
echo "Docker image:"
echo ""
echo '```'
echo "docker pull ghcr.io/${{ github.repository }}:${version}"
echo '```'
} >> release_notes.md

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.ref.outputs.ref }}
name: ${{ steps.ref.outputs.ref }}
body_path: release_notes.md
make_latest: true
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

### Added

- Release automation: pushing a `v*.*.*` tag (or running the `Release` workflow manually) now builds a multi-arch Docker image (`linux/amd64`, `linux/arm64`), publishes it to the GitHub Container Registry (`ghcr.io/izzetee/pipimink`) with `vX.Y.Z`, `X.Y`, and `latest` tags, and creates a GitHub Release with notes extracted from this changelog.

## [0.6.0] — Authentication, Console & Judge Strictness

### Added
Expand Down
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ WORKDIR /app
COPY --from=builder /app/pipimink .

# Copy any required configuration files
# .env.example / providers.example.json are always tracked; real .env and
# providers.json are optional (gitignored) and normally supplied at runtime via
# bind mounts. Listing a guaranteed-present file keeps the COPY from failing in CI
# builds where the real files are absent.
COPY --from=builder /app/.env* ./
COPY --from=builder /app/providers.json* ./
COPY --from=builder /app/providers.example.json /app/providers.json* ./

# Copy static assets for serving
COPY --from=builder /app/assets ./assets
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@ Open `http://localhost:8080` — the setup wizard will guide you through configu

For file-based configuration or advanced setups (Azure AI Foundry, Authentik OAuth, local development), see **[SETUP.md](SETUP.md)**.

### Container image

Prebuilt multi-arch images (`linux/amd64`, `linux/arm64`) are published to the GitHub Container Registry on every release:

```bash
docker pull ghcr.io/izzetee/pipimink:latest # or a specific version, e.g. :v0.6.0
```

## AI-Assisted Development

This project was developed with the assistance of AI coding tools. Contributions that use AI are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md#ai-assisted-development) for guidelines.
Expand Down
Loading