Full Syncthing tray wrapper with: - System tray with 5 icon states (idle/syncing/paused/error/disconnected) - Syncthing REST API client with auto-discovered API key - Long-polling event listener for real-time status - Transfer rate monitoring, folder tracking, recent files, conflict counting - Full context menu with folders, recent files, settings toggles - Embedded admin panel binary (webview, requires CGO) - OS notifications via beeep (per-event configurable) - Syncthing process management with auto-restart - Cross-platform installer with autostart - CI pipeline for Linux (.deb + .tar.gz) and Windows (.zip) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
85
.gitea/workflows/release.yml
Normal file
85
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,85 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Extract version
|
||||
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Install Go
|
||||
run: |
|
||||
curl -sSL https://go.dev/dl/go1.24.1.linux-amd64.tar.gz -o /tmp/go.tar.gz
|
||||
tar -C /usr/local -xzf /tmp/go.tar.gz
|
||||
echo "/usr/local/go/bin" >> $GITHUB_PATH
|
||||
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq gcc g++ mingw-w64 zip libwebkit2gtk-4.0-dev >/dev/null 2>&1
|
||||
|
||||
- name: Install nfpm
|
||||
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
|
||||
|
||||
- name: Build Linux binaries
|
||||
run: |
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o syncwarden ./cmd/syncwarden
|
||||
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o syncwarden-panel ./cmd/panel
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o syncwarden-setup ./cmd/setup
|
||||
|
||||
- name: Build Windows binaries
|
||||
run: |
|
||||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w -H=windowsgui" -o syncwarden.exe ./cmd/syncwarden
|
||||
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build -trimpath -ldflags="-s -w -H=windowsgui" -o syncwarden-panel.exe ./cmd/panel
|
||||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o syncwarden-setup.exe ./cmd/setup
|
||||
|
||||
- name: Build .deb package
|
||||
run: |
|
||||
export PATH=$PATH:$(go env GOPATH)/bin
|
||||
VERSION=${{ env.VERSION }} nfpm package --config packaging/nfpm.yaml --packager deb --target syncwarden_${{ env.VERSION }}_amd64.deb
|
||||
|
||||
- name: Create Linux tarball
|
||||
run: |
|
||||
mkdir -p dist/syncwarden-${{ env.VERSION }}
|
||||
cp syncwarden syncwarden-panel syncwarden-setup dist/syncwarden-${{ env.VERSION }}/
|
||||
cp README.md CHANGELOG.md LICENSE dist/syncwarden-${{ env.VERSION }}/
|
||||
cp packaging/linux/syncwarden.desktop dist/syncwarden-${{ env.VERSION }}/
|
||||
tar -czf syncwarden_${{ env.VERSION }}_linux_amd64.tar.gz -C dist syncwarden-${{ env.VERSION }}
|
||||
|
||||
- name: Create Windows zip
|
||||
run: |
|
||||
mkdir -p dist-win/syncwarden-${{ env.VERSION }}
|
||||
cp syncwarden.exe syncwarden-panel.exe syncwarden-setup.exe dist-win/syncwarden-${{ env.VERSION }}/
|
||||
cp README.md CHANGELOG.md LICENSE dist-win/syncwarden-${{ env.VERSION }}/
|
||||
cd dist-win && zip -r ../syncwarden_${{ env.VERSION }}_windows_amd64.zip syncwarden-${{ env.VERSION }}
|
||||
|
||||
- name: Create Gitea release
|
||||
env:
|
||||
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
run: |
|
||||
API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||
TAG="${GITHUB_REF_NAME}"
|
||||
|
||||
RELEASE_ID=$(curl -s -X POST "${API}/releases" \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"body\":\"See CHANGELOG.md for details.\",\"draft\":false,\"prerelease\":false}" \
|
||||
| grep -o '"id":[0-9]*' | grep -m1 -o '[0-9]*')
|
||||
|
||||
for FILE in \
|
||||
syncwarden_${{ env.VERSION }}_amd64.deb \
|
||||
syncwarden_${{ env.VERSION }}_linux_amd64.tar.gz \
|
||||
syncwarden_${{ env.VERSION }}_windows_amd64.zip; do
|
||||
curl -s -X POST "${API}/releases/${RELEASE_ID}/assets?name=${FILE}" \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-F "attachment=@${FILE}"
|
||||
done
|
||||
Reference in New Issue
Block a user