Compare commits
No commits in common. "main" and "v1.0.0" have entirely different histories.
1 changed files with 77 additions and 64 deletions
|
|
@ -7,77 +7,90 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
description: 'Version tag (e.g. v1.0.1)'
|
description: 'Version tag (e.g. v1.0.0)'
|
||||||
required: false
|
required: false
|
||||||
default: 'v1.0.1'
|
default: 'dev'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-host
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
FORGEJO_RELEASE_TOKEN: ${{ secrets.FORGEJO_RELEASE_TOKEN }}
|
|
||||||
GOPATH: /usr/local/go
|
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare workspace
|
- uses: actions/checkout@v4
|
||||||
run: |
|
|
||||||
export PATH="/usr/local/go/bin:$PATH"
|
|
||||||
go version
|
|
||||||
rm -rf /tmp/ody-build && mkdir -p /tmp/ody-build/dist
|
|
||||||
git clone --depth=1 https://git.wellspr.ing/wellspring/ody-agent.git /tmp/ody-build/src
|
|
||||||
ls /tmp/ody-build/src
|
|
||||||
|
|
||||||
- name: Build all platforms
|
- name: Set up Go
|
||||||
run: |
|
uses: actions/setup-go@v5
|
||||||
export PATH="/usr/local/go/bin:$PATH"
|
with:
|
||||||
cd /tmp/ody-build/src
|
go-version: '1.22'
|
||||||
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build \
|
|
||||||
-ldflags "-s -w -H=windowsgui -X main.defaultServer=https://425.today" \
|
|
||||||
-o /tmp/ody-build/dist/ody-agent-win.exe .
|
|
||||||
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build \
|
|
||||||
-ldflags "-s -w -X main.defaultServer=https://425.today" \
|
|
||||||
-o /tmp/ody-build/dist/ody-agent-mac-arm64 .
|
|
||||||
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build \
|
|
||||||
-ldflags "-s -w -X main.defaultServer=https://425.today" \
|
|
||||||
-o /tmp/ody-build/dist/ody-agent-mac-amd64 .
|
|
||||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build \
|
|
||||||
-ldflags "-s -w -X main.defaultServer=https://425.today" \
|
|
||||||
-o /tmp/ody-build/dist/ody-agent-linux .
|
|
||||||
echo "--- Artifacts ---"
|
|
||||||
ls -lh /tmp/ody-build/dist/
|
|
||||||
|
|
||||||
- name: Publish Forgejo release
|
- name: Set version
|
||||||
|
id: version
|
||||||
run: |
|
run: |
|
||||||
export PATH="/usr/local/go/bin:$PATH"
|
if [ "${{ github.event_name }}" = "push" ]; then
|
||||||
FORGEJO_URL="https://git.wellspr.ing"
|
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||||
REPO="wellspring/ody-agent"
|
|
||||||
if [ -n "$GITHUB_REF" ] && echo "$GITHUB_REF" | grep -q '^refs/tags/'; then
|
|
||||||
VERSION="${GITHUB_REF#refs/tags/}"
|
|
||||||
else
|
else
|
||||||
VERSION="v1.0.1"
|
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
echo "Publishing release: $VERSION"
|
|
||||||
echo "Token present: $([ -n "$FORGEJO_RELEASE_TOKEN" ] && echo yes || echo NO)"
|
- name: Build Windows
|
||||||
EXISTING_ID=$(curl -sf "$FORGEJO_URL/api/v1/repos/$REPO/releases/tags/$VERSION" \
|
working-directory: ody-agent
|
||||||
-H "Authorization: token $FORGEJO_RELEASE_TOKEN" 2>/dev/null \
|
run: |
|
||||||
| python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('id',''))" 2>/dev/null || echo "")
|
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 \
|
||||||
if [ -n "$EXISTING_ID" ]; then
|
go build \
|
||||||
curl -sf -X DELETE "$FORGEJO_URL/api/v1/repos/$REPO/releases/$EXISTING_ID" \
|
-ldflags "-s -w -H=windowsgui -X main.defaultServer=https://425.today" \
|
||||||
-H "Authorization: token $FORGEJO_RELEASE_TOKEN" && echo "Deleted old release $EXISTING_ID"
|
-o ../dist/ody-agent-win.exe .
|
||||||
fi
|
|
||||||
RELEASE=$(curl -sf -X POST "$FORGEJO_URL/api/v1/repos/$REPO/releases" \
|
- name: Build macOS (Apple Silicon)
|
||||||
-H "Authorization: token $FORGEJO_RELEASE_TOKEN" \
|
working-directory: ody-agent
|
||||||
-H "Content-Type: application/json" \
|
run: |
|
||||||
-d "{\"tag_name\":\"$VERSION\",\"name\":\"Ody Agent $VERSION\",\"body\":\"Desktop agent for WellSpr.ing merchants.\",\"draft\":false}")
|
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 \
|
||||||
RELEASE_ID=$(echo "$RELEASE" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
go build \
|
||||||
echo "Release ID: $RELEASE_ID"
|
-ldflags "-s -w -X main.defaultServer=https://425.today" \
|
||||||
for f in /tmp/ody-build/dist/*; do
|
-o ../dist/ody-agent-mac-arm64 .
|
||||||
FNAME=$(basename "$f")
|
|
||||||
echo "Uploading $FNAME..."
|
- name: Build macOS (Intel)
|
||||||
curl -sf -X POST \
|
working-directory: ody-agent
|
||||||
"$FORGEJO_URL/api/v1/repos/$REPO/releases/$RELEASE_ID/assets?name=$FNAME" \
|
run: |
|
||||||
-H "Authorization: token $FORGEJO_RELEASE_TOKEN" \
|
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 \
|
||||||
-H "Content-Type: application/octet-stream" \
|
go build \
|
||||||
--data-binary "@$f"
|
-ldflags "-s -w -X main.defaultServer=https://425.today" \
|
||||||
echo "$FNAME uploaded."
|
-o ../dist/ody-agent-mac-amd64 .
|
||||||
done
|
|
||||||
echo "Done: $FORGEJO_URL/$REPO/releases/tag/$VERSION"
|
- 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" \
|
||||||
|
-o ../dist/ody-agent-linux .
|
||||||
|
|
||||||
|
- name: List artifacts
|
||||||
|
run: ls -lh dist/
|
||||||
|
|
||||||
|
- 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 }}
|
||||||
|
|
||||||
|
Desktop agent for WellSpr.ing / NNN.today merchants.
|
||||||
|
|
||||||
|
### 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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue