Files
EpicNext-Cms/.gitea/workflows/release.yaml
T
openhands 73a36d503a
Local Build and Deploy / deploy (push) Successful in 1m37s
Create Release / release (push) Failing after 13s
fix: combine release workflow into single run block
Each Gitea Actions step is a separate shell session; git context did not
persist between steps. All steps are now in one run block.
2026-07-20 15:03:11 +02:00

69 lines
2.4 KiB
YAML

name: Create Release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: shell
steps:
- name: Checkout, build & release
env:
VERSION: ${{ gitea.ref_name }}
GITEA_API: ${{ gitea.api_url }}
GITEA_REPO: ${{ gitea.repository }}
run: |
set -e
# ── Checkout ────────────────────────────────────────────────
SRC="/tmp/epicnext-release"
rm -rf "$SRC"
git clone --branch "${VERSION}" --depth 1 \
/docker/gitea/gitea/git/repositories/remco/epicnext-cms.git \
"$SRC"
cd "$SRC"
# ── Generate Release Notes ───────────────────────────────────
PREV_TAG="$(git tag --sort=-creatordate | head -2 | tail -1 || echo '')"
if [ -n "$PREV_TAG" ]; then
RANGE="${PREV_TAG}..${VERSION}"
NOTES="$(git log --oneline --no-decorate "${RANGE}" 2>/dev/null || git log --oneline --no-decorate -20)"
else
NOTES="$(git log --oneline --no-decorate -30)"
fi
echo "=== Release Notes ==="
echo "$NOTES"
# ── Build ────────────────────────────────────────────────────
pnpm install --frozen-lockfile
pnpm prisma:generate
export SKIP_ENV_VALIDATION=1
pnpm build
# ── Create Gitea Release ─────────────────────────────────────
BODY="## EpicNext-CMS ${VERSION}
### Changes
${NOTES}
---
_Automated release from Gitea Actions_
"
curl -s -X POST "${GITEA_API}/repos/${GITEA_REPO}/releases" \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-H "Content-Type: application/json" \
-d "$(cat <<-ENDJSON
{
"tag_name": "${VERSION}",
"name": "${VERSION}",
"body": $(echo "$BODY" | jq -Rs '.'),
"draft": false,
"prerelease": false
}
ENDJSON
)"
echo "Release ${VERSION} created successfully!"