5 Commits
v1.0.2 ... main

Author SHA1 Message Date
9054af5c99 bugfix2
All checks were successful
release-tag / release-image (push) Successful in 2m0s
build-binaries / build (, arm, 7, linux) (push) Successful in 45s
build-binaries / build (, amd64, linux) (push) Successful in 46s
build-binaries / build (, arm64, linux) (push) Successful in 47s
build-binaries / build (.exe, amd64, windows) (push) Successful in 47s
build-binaries / release (push) Successful in 26s
build-binaries / publish-agent (push) Successful in 14s
2025-10-26 11:25:15 +01:00
397db150b6 Merge branch 'main' of https://git.send.nrw/patchping/release-agent
Some checks are pending
release-tag / release-image (push) Has started running
2025-10-26 11:24:36 +01:00
3401e45cab bugfix 2025-10-26 11:24:09 +01:00
e85857ccb4 .gitea/workflows/release.yml aktualisiert
All checks were successful
release-tag / release-image (push) Successful in 2m5s
2025-10-26 10:16:39 +00:00
ec550c465f Fixed release.yml due to false product
All checks were successful
release-tag / release-image (push) Successful in 2m5s
2025-10-26 11:09:00 +01:00

View File

@@ -131,43 +131,37 @@ jobs:
PRODUCT: release-agent PRODUCT: release-agent
AGENT_URL: ${{ secrets.AGENT_URL }} AGENT_URL: ${{ secrets.AGENT_URL }}
AGENT_TOKEN: ${{ secrets.AGENT_TOKEN }} AGENT_TOKEN: ${{ secrets.AGENT_TOKEN }}
SERVER_URL: ${{ github.server_url }}
# Funktioniert in GitHub und Gitea (Actions) weitgehend gleich: REPOSITORY: ${{ github.repository }}
SERVER_URL: ${{ github.server_url }} # z.B. https://github.com oder https://gitea.example.com TAG: ${{ github.ref_name }}
REPOSITORY: ${{ github.repository }} # owner/repo
TAG: ${{ github.ref_name }} # vX.Y.Z
steps: steps:
- name: Download artifacts - name: Download artifacts
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
path: ./dist path: ./dist
- name: Publish release metadata to Version Agent - name: Publish release metadata to Version Agent
shell: bash shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
if [[ -z "${AGENT_URL:-}" || -z "${AGENT_TOKEN:-}" ]]; then if [[ -z "${AGENT_URL:-}" || -z "${AGENT_TOKEN:-}" ]]; then
echo "Missing AGENT_URL or AGENT_TOKEN" >&2; exit 1 echo "Missing AGENT_URL or AGENT_TOKEN" >&2; exit 1
fi fi
VERSION="${TAG#v}" # 12.3.1[-rc.1|-beta.1] VERSION="${TAG#v}"
MAJOR="${VERSION%%.*}" # 12 MAJOR="${VERSION%%.*}"
BRANCH="${MAJOR}.x" # 12.x BRANCH="${MAJOR}.x"
CHANNEL="stable" CHANNEL="stable"
[[ "$VERSION" == *"-rc"* ]] && CHANNEL="rc" [[ "$VERSION" == *"-rc"* ]] && CHANNEL="rc"
[[ "$VERSION" == *"-beta"* ]] && CHANNEL="beta" [[ "$VERSION" == *"-beta"* ]] && CHANNEL="beta"
# Optional: Nightly-Channel bei Non-Tag-Builds (separater Job, siehe unten)
RELEASED_AT="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" RELEASED_AT="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
NOTES_URL="${SERVER_URL}/${REPOSITORY}/releases/tag/${TAG}" NOTES_URL="${SERVER_URL}/${REPOSITORY}/releases/tag/${TAG}"
publish() { # args: OS ARCH FILE publish() { # args: OS ARCH FILE
local OS="$1" ARCH="$2" FILE="$3" local OS="$1" ARCH="$2" FILE="$3"
local BIT="64" local BIT="64"; case "$ARCH" in 386|armv7) BIT="32";; esac
case "$ARCH" in 386|armv7) BIT="32";; esac
local FNAME="$(basename "$FILE")" local FNAME="$(basename "$FILE")"
local URL="${SERVER_URL}/${REPOSITORY}/releases/download/${TAG}/${FNAME}" local URL="${SERVER_URL}/${REPOSITORY}/releases/download/${TAG}/${FNAME}"
@@ -177,6 +171,7 @@ jobs:
SIZE="$(stat -c%s "$FILE")" SIZE="$(stat -c%s "$FILE")"
jq -n \ jq -n \
--arg product "$PRODUCT" \
--arg branch "$BRANCH" \ --arg branch "$BRANCH" \
--arg channel "$CHANNEL" \ --arg channel "$CHANNEL" \
--arg arch "$ARCH" \ --arg arch "$ARCH" \
@@ -189,25 +184,21 @@ jobs:
--arg sha256 "$SHA256" \ --arg sha256 "$SHA256" \
--argjson size "$SIZE" \ --argjson size "$SIZE" \
'{ '{
product:$product,
branch:$branch, channel:$channel, arch:$arch, bit:$bit, os:$os, branch:$branch, channel:$channel, arch:$arch, bit:$bit, os:$os,
release:{ release:{
version:$version, released_at:$released_at, notes_url:$notes, version:$version, released_at:$released_at, notes_url:$notes,
assets:[{url:$url, sha256:$sha256, size_bytes:$size}] assets:[{url:$url, sha256:$sha256, size_bytes:$size}]
} }
}' > payload.json }' > payload.json
echo @payload.json
curl -fsS -H "Content-Type: application/json" \ curl -fsS -H "Content-Type: application/json" \
-H "Authorization: Bearer ${AGENT_TOKEN}" \ -H "Authorization: Bearer ${AGENT_TOKEN}" \
-d @payload.json "${AGENT_URL}/v1/publish" -d @payload.json "${AGENT_URL}/v1/publish"
} }
shopt -s nullglob shopt -s nullglob
# linux/amd64
for f in dist/**/${PRODUCT}-linux-amd64.tar.gz; do publish linux amd64 "$f"; done for f in dist/**/${PRODUCT}-linux-amd64.tar.gz; do publish linux amd64 "$f"; done
# linux/arm64
for f in dist/**/${PRODUCT}-linux-arm64.tar.gz; do publish linux arm64 "$f"; done for f in dist/**/${PRODUCT}-linux-arm64.tar.gz; do publish linux arm64 "$f"; done
# linux/armv7
for f in dist/**/${PRODUCT}-linux-armv7.tar.gz; do publish linux armv7 "$f"; done for f in dist/**/${PRODUCT}-linux-armv7.tar.gz; do publish linux armv7 "$f"; done
# windows/amd64
for f in dist/**/${PRODUCT}-windows-amd64.zip; do publish windows amd64 "$f"; done for f in dist/**/${PRODUCT}-windows-amd64.zip; do publish windows amd64 "$f"; done