From c00298aff3b1732641ab6a7198c1cd857a97d594 Mon Sep 17 00:00:00 2001 From: borisdvlpr Date: Sun, 7 Jun 2026 11:03:47 +0100 Subject: [PATCH 1/8] chore: rollback ldflags to use cmd.version on taskfile --- taskfile.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/taskfile.yaml b/taskfile.yaml index 1e53c35..8c4b3ed 100644 --- a/taskfile.yaml +++ b/taskfile.yaml @@ -37,28 +37,28 @@ tasks: desc: Build binary for macOS ARM64 cmds: - echo "Building macOS arm64 binary..." - - CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "-X github.com/borisdvlpr/gotail/main.version={{.VERSION}}" -o {{.BINARY_NAME}}-macos-arm64 {{.MAIN_PATH}} + - CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "-X github.com/borisdvlpr/gotail/cmd.version={{.VERSION}}" -o {{.BINARY_NAME}}-macos-arm64 {{.MAIN_PATH}} - echo "Build completed." build-linux-amd64: desc: Build binary for Linux AMD64 cmds: - echo "Building linux amd64 binary..." - - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/borisdvlpr/gotail/main.version={{.VERSION}}" -o {{.BINARY_NAME}}-linux-amd64 {{.MAIN_PATH}} + - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/borisdvlpr/gotail/cmd.version={{.VERSION}}" -o {{.BINARY_NAME}}-linux-amd64 {{.MAIN_PATH}} - echo "Build completed." build-linux-arm64: desc: Build binary for Linux ARM64 cmds: - echo "Building linux arm64 binary..." - - CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-X github.com/borisdvlpr/gotail/main.version={{.VERSION}}" -o {{.BINARY_NAME}}-linux-arm64 {{.MAIN_PATH}} + - CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-X github.com/borisdvlpr/gotail/cmd.version={{.VERSION}}" -o {{.BINARY_NAME}}-linux-arm64 {{.MAIN_PATH}} - echo "Build completed." build-windows-amd64: desc: Build binary for Windows AMD64 cmds: - echo "Building windows amd64 binary..." - - CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-X github.com/borisdvlpr/gotail/main.version={{.VERSION}}" -o {{.BINARY_NAME}}-windows-amd64.exe {{.MAIN_PATH}} + - CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-X github.com/borisdvlpr/gotail/cmd.version={{.VERSION}}" -o {{.BINARY_NAME}}-windows-amd64.exe {{.MAIN_PATH}} - echo "Build completed." install: From d4c2cfc28f35dba2f74259adb5474bfb3e65988e Mon Sep 17 00:00:00 2001 From: borisdvlpr Date: Sun, 7 Jun 2026 11:06:22 +0100 Subject: [PATCH 2/8] ci: simplify ldflags and inject version correctly on goreleaser file --- .goreleaser.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 16a71e4..72160c0 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -22,7 +22,7 @@ builds: - arm - arm64 ldflags: - - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} + - -s -w -X github.com/borisdvlpr/gotail/cmd.version={{.Version}} archives: - formats: [tar.gz] From 5470a638512076745dcff79e294f7f8a292de7ff Mon Sep 17 00:00:00 2001 From: borisdvlpr Date: Sun, 7 Jun 2026 22:34:08 +0100 Subject: [PATCH 3/8] chore: add Go installation verification task for Windows on Taskfile --- taskfile.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/taskfile.yaml b/taskfile.yaml index 8c4b3ed..6c5bc23 100644 --- a/taskfile.yaml +++ b/taskfile.yaml @@ -20,6 +20,14 @@ tasks: echo "Go version $(go version | awk '{print substr($3, 3)}') is installed at $(which go)." fi + check-go-windows: + desc: Check if Go is installed (Windows) + cmds: + - echo "Checking Go..." + - | + where go > NUL 2>&1 || (echo Error: Go is not installed. Please install Go before proceeding. && exit 1) + for /f "tokens=3" %v in ('go version') do @echo Go version %v is installed. + test: desc: Run all tests cmds: From 1859c815d09facba675eddf6db82f72d7ed10ffe Mon Sep 17 00:00:00 2001 From: borisdvlpr Date: Sun, 7 Jun 2026 22:35:15 +0100 Subject: [PATCH 4/8] chore: separate Go checks by operating system --- taskfile.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/taskfile.yaml b/taskfile.yaml index 6c5bc23..afc47c4 100644 --- a/taskfile.yaml +++ b/taskfile.yaml @@ -10,6 +10,12 @@ vars: tasks: check-go: desc: Check if Go is installed + cmds: + - task: check-go-{{OS}} + + check-go-unix: + desc: Check if Go is installed (Linux/macOS) + aliases: [check-go-linux, check-go-darwin] cmds: - echo "Checking Go..." - | @@ -17,7 +23,7 @@ tasks: echo "Error: Go is not installed. Please install Go before proceeding." exit 1 else - echo "Go version $(go version | awk '{print substr($3, 3)}') is installed at $(which go)." + echo "Go version $(go version | awk '{print substr($3, 3)}') is installed at $(which go) ({{OS}})." fi check-go-windows: From 6ab433b3d2a80de5c581e1d415a5eab60edeb74c Mon Sep 17 00:00:00 2001 From: borisdvlpr Date: Wed, 10 Jun 2026 18:17:05 +0100 Subject: [PATCH 5/8] ci: configure Homebrew tap publishing --- .github/workflows/release.yaml | 3 ++- .goreleaser.yaml | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 93c0408..da5ec7d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -40,4 +40,5 @@ jobs: version: "~> v2" args: release --clean env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 72160c0..a5a9414 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -55,6 +55,20 @@ nfpms: - rpm - archlinux +brews: + - repository: + owner: borisdvlpr + name: homebrew-gotail + token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" + directory: Formula + homepage: https://github.com/borisdvlpr/gotail + description: "Bootstrap Tailscale into your Raspberry Pi from the very first boot." + license: BSD-3-Clause + test: | + system "#{bin}/gotail --version" + install: | + bin.install "gotail" + changelog: sort: asc filters: From f117d9733a812f391256deb8bb1ca3aa26e72209 Mon Sep 17 00:00:00 2001 From: borisdvlpr Date: Wed, 10 Jun 2026 22:48:16 +0100 Subject: [PATCH 6/8] ci: configure Winget package publishing --- .github/workflows/release.yaml | 1 + .goreleaser.yaml | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index da5ec7d..a5235c8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -42,3 +42,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} + WINGET_GITHUB_TOKEN: ${{ secrets.WINGET_GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index a5a9414..d74db54 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -69,6 +69,32 @@ brews: install: | bin.install "gotail" +winget: + - name: gotail + package_identifier: borisdvlpr.gotail + publisher: borisdvlpr + license: BSD-3-Clause + copyright: "Eduardo Miranda" + homepage: https://github.com/borisdvlpr/gotail + short_description: "Bootstrap Tailscale into your Raspberry Pi from the very first boot." + description: |- + Bootstrap Tailscale into your Raspberry Pi and join it to your + tailnet automatically from the very first boot. + publisher_url: https://github.com/borisdvlpr + publisher_support_url: https://github.com/borisdvlpr/gotail/issues + repository: + owner: borisdvlpr + name: winget-pkgs + branch: "gotail-{{.Version}}" + token: "{{ .Env.WINGET_GITHUB_TOKEN }}" + pull_request: + enabled: true + draft: true + base: + owner: microsoft + name: winget-pkgs + branch: master + changelog: sort: asc filters: From 37fa77585330678e17e6664328c4aba9ced1310b Mon Sep 17 00:00:00 2001 From: borisdvlpr Date: Thu, 11 Jun 2026 23:40:21 +0100 Subject: [PATCH 7/8] chore: refactor taskfile --- .github/workflows/pull-request.yaml | 2 +- taskfile.yaml | 116 +++++++--------------------- 2 files changed, 28 insertions(+), 90 deletions(-) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 424f43d..18513f4 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -17,4 +17,4 @@ jobs: uses: actions/checkout@v6 - name: Test - uses: ./.github/actions/test \ No newline at end of file + uses: ./.github/actions/test diff --git a/taskfile.yaml b/taskfile.yaml index afc47c4..87f2735 100644 --- a/taskfile.yaml +++ b/taskfile.yaml @@ -5,125 +5,63 @@ silent: true vars: MAIN_PATH: . BINARY_NAME: bin/gotail - VERSION: '{{.VERSION | default "$(cat version.txt)"}}-snapshot' + EXE: '{{if eq OS "windows"}}.exe{{end}}' + VERSION: + sh: cat version.txt tasks: check-go: - desc: Check if Go is installed + desc: Verify that Go is installed cmds: - - task: check-go-{{OS}} - - check-go-unix: - desc: Check if Go is installed (Linux/macOS) - aliases: [check-go-linux, check-go-darwin] - cmds: - - echo "Checking Go..." - | if ! command -v go >/dev/null 2>&1; then echo "Error: Go is not installed. Please install Go before proceeding." exit 1 - else - echo "Go version $(go version | awk '{print substr($3, 3)}') is installed at $(which go) ({{OS}})." fi - - check-go-windows: - desc: Check if Go is installed (Windows) - cmds: - - echo "Checking Go..." - - | - where go > NUL 2>&1 || (echo Error: Go is not installed. Please install Go before proceeding. && exit 1) - for /f "tokens=3" %v in ('go version') do @echo Go version %v is installed. + echo "Using $(go version)." test: - desc: Run all tests + desc: Run unit tests cmds: - echo "Running unit tests..." - - go test ./... -v 2>&1 || (echo "Tests failed." && exit 1) + - go test ./... -v - echo "Tests passed." build: - desc: Build binary for current platform + desc: Build the binary for the current platform deps: [check-go, test] + env: + CGO_ENABLED: "0" cmds: - - task: build-{{OS}}-{{ARCH}} - - build-darwin-arm64: - desc: Build binary for macOS ARM64 - cmds: - - echo "Building macOS arm64 binary..." - - CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "-X github.com/borisdvlpr/gotail/cmd.version={{.VERSION}}" -o {{.BINARY_NAME}}-macos-arm64 {{.MAIN_PATH}} - - echo "Build completed." - - build-linux-amd64: - desc: Build binary for Linux AMD64 - cmds: - - echo "Building linux amd64 binary..." - - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/borisdvlpr/gotail/cmd.version={{.VERSION}}" -o {{.BINARY_NAME}}-linux-amd64 {{.MAIN_PATH}} - - echo "Build completed." - - build-linux-arm64: - desc: Build binary for Linux ARM64 - cmds: - - echo "Building linux arm64 binary..." - - CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-X github.com/borisdvlpr/gotail/cmd.version={{.VERSION}}" -o {{.BINARY_NAME}}-linux-arm64 {{.MAIN_PATH}} - - echo "Build completed." - - build-windows-amd64: - desc: Build binary for Windows AMD64 - cmds: - - echo "Building windows amd64 binary..." - - CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-X github.com/borisdvlpr/gotail/cmd.version={{.VERSION}}" -o {{.BINARY_NAME}}-windows-amd64.exe {{.MAIN_PATH}} + - echo "Building gotail for {{OS}}/{{ARCH}}..." + - go build -ldflags "-X github.com/borisdvlpr/gotail/cmd.version={{.VERSION}}-snapshot" -o {{.BINARY_NAME}}{{.EXE}} {{.MAIN_PATH}} - echo "Build completed." install: - desc: Install binary to local path + desc: Install the binary into your user bin directory deps: [build] cmds: - - | - if [ "{{OS}}" = "windows" ]; then - echo "Installing gotail on $USERPROFILE/AppData/Local/Microsoft/WindowsApps..." + - cmd: | mkdir -p "$USERPROFILE/AppData/Local/Microsoft/WindowsApps" - cp {{.BINARY_NAME}}-windows-amd64.exe "$USERPROFILE/AppData/Local/Microsoft/WindowsApps/gotail.exe" - - elif [ "{{OS}}" = "linux" ]; then - echo "Installing gotail on $HOME/.local/bin..." - mkdir -p $HOME/.local/bin - if [ "{{ARCH}}" = "amd64" ]; then - cp {{.BINARY_NAME}}-linux-amd64 $HOME/.local/bin/gotail - elif [ "{{ARCH}}" = "arm64" ]; then - cp {{.BINARY_NAME}}-linux-arm64 $HOME/.local/bin/gotail - else - echo "Unsupported Linux architecture: {{ARCH}}" - exit 1 - fi - elif [ "{{OS}}" = "darwin" ]; then - echo "Installing gotail on $HOME/.local/bin..." - mkdir -p $HOME/.local/bin - if [ "{{ARCH}}" = "arm64" ]; then - cp {{.BINARY_NAME}}-macos-arm64 $HOME/.local/bin/gotail - else - echo "Unsupported macOS architecture: {{ARCH}}" - exit 1 - fi - else - echo "Unsupported operating system: {{OS}}" - exit 1 - fi + cp {{.BINARY_NAME}}.exe "$USERPROFILE/AppData/Local/Microsoft/WindowsApps/gotail.exe" + platforms: [windows] + - cmd: | + mkdir -p "$HOME/.local/bin" + cp {{.BINARY_NAME}} "$HOME/.local/bin/gotail" + platforms: [linux, darwin] - echo "gotail installed successfully." clean: - desc: Clean up build artifacts and local installation + desc: Remove build artifacts and the installed binary cmds: - - echo "Cleaning local installation..." - rm -rf bin/ - - | - if [ "{{OS}}" = "windows" ]; then - rm -f "$USERPROFILE/AppData/Local/Microsoft/WindowsApps/gotail.exe" - else - rm -f $HOME/.local/bin/gotail - fi + - cmd: rm -f "$USERPROFILE/AppData/Local/Microsoft/WindowsApps/gotail.exe" + platforms: [windows] + - cmd: rm -f "$HOME/.local/bin/gotail" + platforms: [linux, darwin] + - echo "Cleaned up." all: - desc: Build and install the application + desc: Build, test, and install gotail cmds: - task: install From 13c6091a4116d6c71b6f6381518683c45227061f Mon Sep 17 00:00:00 2001 From: borisdvlpr Date: Fri, 12 Jun 2026 00:04:26 +0100 Subject: [PATCH 8/8] ci(release): update release workflow to publish Linux packages to Cloudsmith --- .github/workflows/release.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a5235c8..f49aaaf 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,3 +43,19 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} WINGET_GITHUB_TOKEN: ${{ secrets.WINGET_GITHUB_TOKEN }} + + - name: Publish Linux packages to Cloudsmith + env: + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + run: | + shopt -s nullglob + pip install --upgrade cloudsmith-cli + for pkg in dist/*.deb; do + cloudsmith push deb borisdvlpr/gotail/any-distro/any-version "$pkg" + done + for pkg in dist/*.rpm; do + cloudsmith push rpm borisdvlpr/gotail/any-distro/any-version "$pkg" + done + for pkg in dist/*.apk; do + cloudsmith push alpine borisdvlpr/gotail/alpine/any-version "$pkg" + done