mirror of
https://github.com/bretzel-app/crumbs.git
synced 2026-10-12 20:06:57 +02:00
- Update release.sh to also bump docker-compose.yml image tag in the same commit, keeping the tagged commit in sync - Add CI and Docker release jobs to bump.yml so it's self-contained (GITHUB_TOKEN pushes don't trigger other workflows) - Remove "Pin docker-compose" post-step from release.yml since it's now handled by release.sh Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
98 lines
2.5 KiB
YAML
98 lines
2.5 KiB
YAML
name: Bump & Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
bump:
|
|
description: 'Override bump type (leave empty to auto-detect)'
|
|
required: false
|
|
type: choice
|
|
options:
|
|
- ''
|
|
- patch
|
|
- minor
|
|
- major
|
|
|
|
jobs:
|
|
bump:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
outputs:
|
|
tag: ${{ steps.release-tag.outputs.tag }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Configure git
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Run release script
|
|
env:
|
|
BUMP_TYPE: ${{ github.event.inputs.bump }}
|
|
run: bash scripts/release.sh "$BUMP_TYPE"
|
|
|
|
- name: Output new tag
|
|
id: release-tag
|
|
run: echo "tag=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT"
|
|
|
|
ci:
|
|
needs: bump
|
|
uses: ./.github/workflows/ci.yml
|
|
|
|
release:
|
|
name: Build & Push Docker Image
|
|
runs-on: ubuntu-latest
|
|
needs: [bump, ci]
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ needs.bump.outputs.tag }}
|
|
|
|
- name: Extract metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ghcr.io/${{ github.repository }}
|
|
tags: |
|
|
type=semver,pattern={{version}},value=${{ needs.bump.outputs.tag }}
|
|
type=semver,pattern={{major}}.{{minor}},value=${{ needs.bump.outputs.tag }}
|
|
type=raw,value=latest
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ needs.bump.outputs.tag }}
|
|
generate_release_notes: true
|