From 75f8a006eaa636bd608616f2a93003c916a0d597 Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Sat, 23 May 2026 17:30:41 -0500 Subject: [PATCH 1/2] fix(ci): replace tea CLI with curl in changelog steps; read Cargo.toml for version tea is not available in alpine:latest containers. Replace both tea calls with curl API requests against the Gitea releases endpoint. Also: auto-tag now reads src-tauri/Cargo.toml version first. If it is ahead of the latest git tag (major/minor bump), that version is used directly instead of incrementing the patch. --- .gitea/workflows/auto-tag.yml | 66 +++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/auto-tag.yml b/.gitea/workflows/auto-tag.yml index 844eda41..29882c60 100644 --- a/.gitea/workflows/auto-tag.yml +++ b/.gitea/workflows/auto-tag.yml @@ -30,14 +30,34 @@ jobs: API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY" + # Checkout the source so we can read Cargo.toml + git init + git remote add origin "http://oauth2:${RELEASE_TOKEN}@172.0.0.29:3000/${GITHUB_REPOSITORY}.git" + git fetch --depth=1 origin "$GITHUB_SHA" + git checkout FETCH_HEAD + git config user.name "gitea-actions[bot]" + git config user.email "gitea-actions@local" + + # Read the version declared in Cargo.toml + CARGO_VERSION=$(grep '^version' src-tauri/Cargo.toml | head -1 | sed 's/version = "//;s/"//') + CARGO_TAG="v${CARGO_VERSION}" + echo "Cargo.toml declares: $CARGO_TAG" + # Get the latest clean semver tag (vX.Y.Z only, ignore rc/test suffixes) LATEST=$(curl -s "$API/tags?limit=50" \ -H "Authorization: token $RELEASE_TOKEN" | \ jq -r '.[].name' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | \ sort -V | tail -1) + echo "Latest git tag: ${LATEST:-none}" + # If Cargo.toml declares a higher version, honour it (major/minor bump). + # Otherwise fall back to auto-incrementing the patch on the latest tag. if [ -z "$LATEST" ]; then - NEXT="v0.1.0" + NEXT="$CARGO_TAG" + elif [ "$(printf '%s\n' "$LATEST" "$CARGO_TAG" | sort -V | tail -1)" = "$CARGO_TAG" ] \ + && [ "$CARGO_TAG" != "$LATEST" ]; then + echo "Cargo.toml version $CARGO_TAG is ahead of latest tag $LATEST — using Cargo.toml" + NEXT="$CARGO_TAG" else MAJOR=$(echo "$LATEST" | cut -d. -f1 | tr -d 'v') MINOR=$(echo "$LATEST" | cut -d. -f2) @@ -47,14 +67,6 @@ jobs: echo "Latest tag: ${LATEST:-none} → Next: $NEXT" - # Create and push the tag via git. - git init - git remote add origin "http://oauth2:${RELEASE_TOKEN}@172.0.0.29:3000/${GITHUB_REPOSITORY}.git" - git fetch --depth=1 origin "$GITHUB_SHA" - git checkout FETCH_HEAD - git config user.name "gitea-actions[bot]" - git config user.email "gitea-actions@local" - if git ls-remote --exit-code --tags origin "refs/tags/$NEXT" >/dev/null 2>&1; then echo "Tag $NEXT already exists; skipping." exit 0 @@ -114,10 +126,23 @@ jobs: cat /tmp/release_body.md - name: Update Gitea release body + env: + RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} run: | set -eu TAG=$(git describe --tags --abbrev=0) - tea releases edit "$TAG" --note "@/tmp/release_body.md" --repo "$GITHUB_REPOSITORY" --login gogs.tftsr.com + API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY" + RELEASE_ID=$(curl -sf "$API/releases/tags/$TAG" \ + -H "Authorization: token $RELEASE_TOKEN" | jq -r '.id') + if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "null" ]; then + echo "ERROR: Could not find release for tag $TAG" + exit 1 + fi + BODY=$(jq -n --rawfile note /tmp/release_body.md '{body: $note}') + curl -sf -X PATCH "$API/releases/$RELEASE_ID" \ + -H "Authorization: token $RELEASE_TOKEN" \ + -H "Content-Type: application/json" \ + -d "$BODY" echo "✓ Release body updated" - name: Commit CHANGELOG.md to master @@ -135,10 +160,29 @@ jobs: echo "✓ CHANGELOG.md committed to master" - name: Upload CHANGELOG.md as release asset + env: + RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} run: | set -eu TAG=$(git describe --tags --abbrev=0) - tea releases edit "$TAG" --asset CHANGELOG.md --repo "$GITHUB_REPOSITORY" --login gogs.tftsr.com + API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY" + RELEASE_ID=$(curl -sf "$API/releases/tags/$TAG" \ + -H "Authorization: token $RELEASE_TOKEN" | jq -r '.id') + if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "null" ]; then + echo "ERROR: Could not find release for tag $TAG" + exit 1 + fi + # Delete existing asset if present to allow re-upload + EXISTING_ID=$(curl -sf "$API/releases/$RELEASE_ID" \ + -H "Authorization: token $RELEASE_TOKEN" \ + | jq -r '.assets[]? | select(.name == "CHANGELOG.md") | .id') + if [ -n "$EXISTING_ID" ]; then + curl -sf -X DELETE "$API/releases/$RELEASE_ID/assets/$EXISTING_ID" \ + -H "Authorization: token $RELEASE_TOKEN" + fi + curl -sf -X POST "$API/releases/$RELEASE_ID/assets" \ + -H "Authorization: token $RELEASE_TOKEN" \ + -F "attachment=@CHANGELOG.md;filename=CHANGELOG.md" echo "✓ CHANGELOG.md uploaded" wiki-sync: -- 2.45.2 From 28f579a1aeeb1b427e1f7422e9b58496e527b057 Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Sat, 23 May 2026 17:36:38 -0500 Subject: [PATCH 2/2] fix: bump tauri.conf.json version to 0.3.0 Cargo.toml was updated to 0.3.0 for the MCP feature but tauri.conf.json was missed. Bundle artifact filenames are derived from tauri.conf.json, so all builds were producing files named 0.2.68. --- src-tauri/tauri.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index edf853bb..05ceb855 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,6 +1,6 @@ { "productName": "Troubleshooting and RCA Assistant", - "version": "0.2.68", + "version": "0.3.0", "identifier": "com.trcaa.app", "build": { "frontendDist": "../dist", -- 2.45.2