Files
winnow/.github/workflows/release.yml
T
flanandgithub-actions[bot] 8acf8b52b8 fix: Immich v2.7.5 compat, supply-chain hardening, and quality fixes (0.5.2) (#23)
* fix: Immich v2.7.5 compat, supply-chain hardening, and quality fixes (0.5.2)

- Remove assetCount pre-filter broken by Immich v2.7.5 API change; check
  MIN_FACE_COUNT after fetch_all_assets instead
- Replace curl|sh uv installer with COPY --from Docker stage (supply chain)
- Fix HEALTHCHECK to use kill -0 on PID file instead of static file test
- Fix CONFIG_FILE path to resolve inside DATA_DIR for volume persistence
- Fix EmbeddingCache singleton to re-init when cache_dir changes
- Fix fd leak in _suppress_output() with nested finally closes
- Fix silent exception on SQLite connection close in upload_tracker
- Log unexpected Frigate API keys at DEBUG in get_all_frigate_person_files
- Add reconcile FIFO-mapping debug log
- Pin all CI action SHAs; update setup-uv v8.2.0, upload/download-artifact,
  ruff-action v4.0.0

* chore: update lockfile

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-14 19:15:20 -04:00

142 lines
4.5 KiB
YAML

name: Create GitHub Release
on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
version:
description: "Version to release (e.g., 1.0.0)"
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
name: Create GitHub Release
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
tag: ${{ steps.tag.outputs.TAG }}
version: ${{ steps.tag.outputs.VERSION }}
steps:
- name: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
echo "Disk space freed."
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- name: Set up Python
run: uv python install 3.13
- name: Verify release branch
if: github.event_name == 'workflow_dispatch'
run: |
if [ "${{ github.ref_name }}" != "main" ]; then
echo "::error::Releases must be dispatched from main (current: ${{ github.ref_name }})"
exit 1
fi
- name: Ensure lockfile is current
run: uv lock
- name: Resolve tag name
id: tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "TAG=v${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
echo "VERSION=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
else
TAG="${GITHUB_REF_NAME}"
echo "TAG=${TAG}" >> "$GITHUB_OUTPUT"
echo "VERSION=${TAG#v}" >> "$GITHUB_OUTPUT"
fi
- name: Create and push tag (workflow_dispatch only)
if: github.event_name == 'workflow_dispatch'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
TAG="${{ steps.tag.outputs.TAG }}"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists, skipping creation."
else
git tag "$TAG"
git push origin "$TAG"
fi
- name: Extract changelog for this version
id: changelog
run: |
VERSION="${{ steps.tag.outputs.VERSION }}"
if [ ! -f CHANGELOG.md ]; then
echo "⚠️ CHANGELOG.md not found, using empty notes."
echo "NOTES=" >> "$GITHUB_OUTPUT"
exit 0
fi
NOTES=$(awk "/^## \[$VERSION\]/{found=1; next} found && /^## \[/{exit} found{print}" CHANGELOG.md)
if [ -z "$NOTES" ]; then
echo "⚠️ No changelog entry found for version $VERSION."
echo "NOTES=" >> "$GITHUB_OUTPUT"
else
{
echo "NOTES<<CHANGELOG_EOF"
echo "$NOTES"
echo "CHANGELOG_EOF"
} >> "$GITHUB_OUTPUT"
fi
- name: Create GitHub Release
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
RELEASE_TAG: ${{ steps.tag.outputs.TAG }}
RELEASE_NOTES: ${{ steps.changelog.outputs.NOTES }}
with:
script: |
const tag = process.env.RELEASE_TAG;
const notes = (process.env.RELEASE_NOTES || '').trim();
try {
const existing = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: tag,
});
console.log(`Release ${tag} already exists (id ${existing.data.id}), skipping creation.`);
} catch (err) {
if (err.status !== 404) throw err;
await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: tag,
name: `Release ${tag}`,
body: notes || `Release ${tag}`,
draft: false,
prerelease: false,
});
}
build-images:
name: Build and push Docker images
needs: release
uses: ./.github/workflows/docker-publish.yml
with:
tag: ${{ needs.release.outputs.tag }}
version: ${{ needs.release.outputs.version }}
secrets: inherit
permissions:
packages: write
contents: read