snipe/.forgejo/workflows/release.yml
pyr0ball eb05be0612
Some checks are pending
CI / API — lint + test (pull_request) Waiting to run
CI / Web — typecheck + test + build (pull_request) Waiting to run
feat: wire Forgejo Actions CI/CD workflows (#22)
- ci.yml: API lint (ruff F+I) + pytest, web vue-tsc + vitest + build
- mirror.yml: push to GitHub (CircuitForgeLLC) + Codeberg (CircuitForge) on main/tags
- release.yml: Docker build → Forgejo registry + release via API; GHCR deferred pending BSL policy (cf-agents#3)
- .cliff.toml: git-cliff changelog config for semver releases
- pyproject.toml: add [dev] extras (pytest, ruff), ruff config
- Fix 45 ruff violations across codebase (import sorting, unused vars, unused imports)
2026-04-06 00:00:28 -07:00

67 lines
2.2 KiB
YAML

name: Release
on:
push:
tags: ["v*"]
jobs:
release:
name: Build images + create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate changelog
uses: orhun/git-cliff-action@v3
id: cliff
with:
config: .cliff.toml
args: --current --strip header
env:
OUTPUT: CHANGES.md
- uses: docker/setup-buildx-action@v3
# BSL product: push to Forgejo registry only.
# GHCR push is deferred pending license-gate-at-startup implementation (Circuit-Forge/snipe#3).
- uses: docker/login-action@v3
with:
registry: git.opensourcesolarpunk.com
username: ${{ gitea.actor }}
password: ${{ secrets.FORGEJO_RELEASE_TOKEN }}
- name: Build and push API image
uses: docker/build-push-action@v5
with:
context: .
file: docker/api/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: |
git.opensourcesolarpunk.com/circuit-forge/snipe-api:${{ gitea.ref_name }}
git.opensourcesolarpunk.com/circuit-forge/snipe-api:latest
- name: Build and push web image
uses: docker/build-push-action@v5
with:
context: .
file: docker/web/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: |
git.opensourcesolarpunk.com/circuit-forge/snipe-web:${{ gitea.ref_name }}
git.opensourcesolarpunk.com/circuit-forge/snipe-web:latest
- name: Create Forgejo release
env:
FORGEJO_RELEASE_TOKEN: ${{ secrets.FORGEJO_RELEASE_TOKEN }}
TAG: ${{ gitea.ref_name }}
run: |
body=$(cat CHANGES.md | python3 -c "import sys, json; print(json.dumps(sys.stdin.read()))")
curl -sf -X POST \
"https://git.opensourcesolarpunk.com/api/v1/repos/Circuit-Forge/snipe/releases" \
-H "Authorization: token ${FORGEJO_RELEASE_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${TAG}\", \"body\": ${body}}"