Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

add GoReleaser: compressed archives, checksums, version flag, auto changelog

L265680398e38
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c9cabdbb..76aa19bd 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -61,42 +61,24 @@ jobs:
version: v2.9.0
release:
- name: Release Binaries
+ name: Release
if: startsWith(github.ref, 'refs/tags/v')
needs: [build, lint]
runs-on: ubuntu-latest
permissions:
contents: write
- strategy:
- matrix:
- include:
- - goos: linux
- goarch: amd64
- - goos: linux
- goarch: arm64
- - goos: darwin
- goarch: amd64
- - goos: darwin
- goarch: arm64
- - goos: windows
- goarch: amd64
steps:
- uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '1.25'
- - name: Build
- env:
- GOOS: ${{ matrix.goos }}
- GOARCH: ${{ matrix.goarch }}
- run: |
- EXT=""
- if [ "$GOOS" = "windows" ]; then EXT=".exe"; fi
- go build -ldflags="-s -w" -o "pinchtab-${GOOS}-${GOARCH}${EXT}" .
-
- - name: Upload to release
- uses: softprops/action-gh-release@v2
+ - uses: goreleaser/goreleaser-action@v6
with:
- files: pinchtab-*
+ version: latest
+ args: release --clean
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.goreleaser.yml b/.goreleaser.yml
new file mode 100644
index 00000000..47a354e9
--- /dev/null
+++ b/.goreleaser.yml
@@ -0,0 +1,34 @@
+version: 2
+
+builds:
+ - ldflags:
+ - -s -w -X main.version={{.Version}}
+ goos:
+ - linux
+ - darwin
+ - windows
+ goarch:
+ - amd64
+ - arm64
+
+archives:
+ - format_overrides:
+ - goos: windows
+ format: zip
+ name_template: "pinchtab-{{.Os}}-{{.Arch}}"
+
+checksum:
+ name_template: checksums.txt
+
+changelog:
+ sort: asc
+ filters:
+ exclude:
+ - '^docs:'
+ - '^ci:'
+ - '^chore:'
+
+release:
+ github:
+ owner: luigi-agosti
+ name: pinchtab
diff --git a/main.go b/main.go
index a94c2143..8450f63c 100644
--- a/main.go
+++ b/main.go
@@ -2,6 +2,7 @@ package main
import (
"context"
+ "fmt"
"log/slog"
"net/http"
"os"
@@ -12,9 +13,17 @@ import (
"github.com/chromedp/chromedp"
)
+// version is set by goreleaser via ldflags
+var version = "dev"
+
var bridge Bridge
func main() {
+ if len(os.Args) > 1 && (os.Args[1] == "--version" || os.Args[1] == "-v") {
+ fmt.Printf("pinchtab %s\n", version)
+ os.Exit(0)
+ }
+
if err := os.MkdirAll(stateDir, 0755); err != nil {
slog.Error("cannot create state dir", "err", err)
os.Exit(1)