From 9716b833a05f9705af17f15f33aacafe7d0df674 Mon Sep 17 00:00:00 2001 From: gitadmin Date: Fri, 24 Apr 2026 02:39:48 +0000 Subject: [PATCH] fix(ci): use explicit github.com/ action URLs; replace gitea-release with direct API upload --- .forgejo/workflows/release.yml | 86 ++++++++++++++-------------------- 1 file changed, 34 insertions(+), 52 deletions(-) diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index c255149..6af1425 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -15,10 +15,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: https://github.com/actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v5 + uses: https://github.com/actions/setup-go@v5 with: go-version: '1.22' @@ -31,66 +31,48 @@ jobs: echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT fi - - name: Build Windows - working-directory: ody-agent + - name: Build all platforms run: | + mkdir -p dist + cd ody-agent GOOS=windows GOARCH=amd64 CGO_ENABLED=0 \ - go build \ - -ldflags "-s -w -H=windowsgui -X main.defaultServer=https://425.today" \ + go build -ldflags "-s -w -H=windowsgui -X main.defaultServer=https://425.today" \ -o ../dist/ody-agent-win.exe . - - - name: Build macOS (Apple Silicon) - working-directory: ody-agent - run: | GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 \ - go build \ - -ldflags "-s -w -X main.defaultServer=https://425.today" \ + go build -ldflags "-s -w -X main.defaultServer=https://425.today" \ -o ../dist/ody-agent-mac-arm64 . - - - name: Build macOS (Intel) - working-directory: ody-agent - run: | GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 \ - go build \ - -ldflags "-s -w -X main.defaultServer=https://425.today" \ + go build -ldflags "-s -w -X main.defaultServer=https://425.today" \ -o ../dist/ody-agent-mac-amd64 . - - - name: Build Linux - working-directory: ody-agent - run: | GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \ - go build \ - -ldflags "-s -w -X main.defaultServer=https://425.today" \ + go build -ldflags "-s -w -X main.defaultServer=https://425.today" \ -o ../dist/ody-agent-linux . + ls -lh ../dist/ - - name: List artifacts - run: ls -lh dist/ + - name: Create release and upload assets + run: | + VERSION="${{ steps.version.outputs.VERSION }}" + echo "Publishing release $VERSION" - - name: Create release - uses: actions/gitea-release@v1 - with: - token: ${{ secrets.FORGEJO_TOKEN }} - tag_name: ${{ steps.version.outputs.VERSION }} - release_name: "Ody Agent ${{ steps.version.outputs.VERSION }}" - body: | - ## Ody Agent ${{ steps.version.outputs.VERSION }} + # Create the release (may already exist from manual tag push) + RELEASE=$(curl -sf -X POST "https://git.wellspr.ing/api/v1/repos/wellspring/ody-agent/releases" \ + -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \ + -H "Content-Type: application/json" \ + -d "{\"tag_name\":\"$VERSION\",\"name\":\"Ody Agent $VERSION\",\"body\":\"### Ody Agent $VERSION\n\nDesktop agent for WellSpr.ing / NNN.today merchants.\n\n| Platform | File |\n|---|---|\n| Windows | \`ody-agent-win.exe\` |\n| macOS Apple Silicon | \`ody-agent-mac-arm64\` |\n| macOS Intel | \`ody-agent-mac-amd64\` |\n| Linux | \`ody-agent-linux\` |\",\"draft\":false,\"prerelease\":false}" \ + || curl -sf "https://git.wellspr.ing/api/v1/repos/wellspring/ody-agent/releases/tags/$VERSION" \ + -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}") - Desktop agent for WellSpr.ing / NNN.today merchants. + RELEASE_ID=$(echo "$RELEASE" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])") + echo "Release ID: $RELEASE_ID" - ### Downloads - | Platform | File | - |----------|------| - | Windows (64-bit) | `ody-agent-win.exe` | - | macOS Apple Silicon | `ody-agent-mac-arm64` | - | macOS Intel | `ody-agent-mac-amd64` | - | Linux (64-bit) | `ody-agent-linux` | - - ### Quick setup - 1. Download the binary for your platform - 2. Get your `config.env` from the merchant dashboard → AI Agent tab - 3. Place both files in the same folder and run the agent - files: | - dist/ody-agent-win.exe - dist/ody-agent-mac-arm64 - dist/ody-agent-mac-amd64 - dist/ody-agent-linux + for f in dist/*; do + FNAME=$(basename "$f") + echo "Uploading $FNAME..." + curl -sf -X POST \ + "https://git.wellspr.ing/api/v1/repos/wellspring/ody-agent/releases/$RELEASE_ID/assets?name=$FNAME" \ + -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \ + -H "Content-Type: application/octet-stream" \ + --data-binary "@$f" + echo " uploaded." + done + echo "Release complete: https://git.wellspr.ing/wellspring/ody-agent/releases/tag/$VERSION"