fix(ci): use explicit github.com/ action URLs; replace gitea-release with direct API upload
This commit is contained in:
parent
557eadaa0a
commit
9716b833a0
1 changed files with 34 additions and 52 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue