Files
drover-go/.gitea/workflows/build.yml
T
root 5da30ad058
Build / test (push) Successful in 1m13s
Build / build-windows (push) Successful in 55s
GUI subsystem: -H=windowsgui + AttachConsole, MB_TOPMOST on test window
drover.exe is now a GUI subsystem binary:
  - Double-click no longer flashes a console window — a clean
    smoke-test message box opens immediately.
  - When run from cmd / PowerShell, AttachConsole reattaches stdout
    and stderr to the parent terminal so '--version', 'check', etc.
    still print as expected.
  - MB_TOPMOST flag added to MessageBox so the window can't be
    obscured by other windows on launch (this was the actual cause
    of "I clicked but nothing happened" reports).

Verified locally: built with GOOS=windows GOARCH=amd64 -H=windowsgui;
running drover-gui.exe --version prints to PowerShell, drover-gui.exe
gui shows the message box on top of the active window.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 03:11:50 +03:00

106 lines
3.1 KiB
YAML

name: Build
on:
push:
branches: [main]
paths-ignore:
- 'docs/**'
- 'README.md'
- 'LICENSE'
- '*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
# Node.js is installed at the start of every job so actions/cache@v4
# (which uses Node) can run. Installing Node costs ~10s; the resulting
# Go module + apt cache restore typically saves 30-60s on warm runs.
jobs:
test:
runs-on: go
steps:
- name: Install Node (required by actions/cache)
run: |
apt-get update >/dev/null
apt-get install -y --no-install-recommends nodejs >/dev/null
- name: Checkout
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git clone --no-checkout "https://x-access-token:${GITHUB_TOKEN}@git.okcu.io/${GITHUB_REPOSITORY}.git" /tmp/src
git -C /tmp/src checkout "$GITHUB_SHA"
cp -a /tmp/src/. .
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
restore-keys: go-${{ runner.os }}-
- name: Vet
run: go vet ./...
- name: Test with race
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Linux smoke build
run: |
mkdir -p bin
go build -trimpath -ldflags="-s -w" -o bin/drover ./cmd/drover
./bin/drover --version
build-windows:
runs-on: go
needs: test
steps:
- name: Install Node (required by actions/cache)
run: |
apt-get update >/dev/null
apt-get install -y --no-install-recommends nodejs >/dev/null
- name: Checkout
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git clone --no-checkout "https://x-access-token:${GITHUB_TOKEN}@git.okcu.io/${GITHUB_REPOSITORY}.git" /tmp/src
git -C /tmp/src checkout "$GITHUB_SHA"
cp -a /tmp/src/. .
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
restore-keys: go-${{ runner.os }}-
- name: Cross-compile drover.exe (windows/amd64)
env:
GOOS: windows
GOARCH: amd64
CGO_ENABLED: '0'
run: |
SHORT_SHA="${GITHUB_SHA:0:7}"
BUILD_DATE="$(date -u +%Y-%m-%d)"
mkdir -p bin
# -H=windowsgui = subsystem WINDOWS, double-click no longer
# flashes a console window. main.go calls AttachConsole on
# startup so CLI invocations from cmd/PowerShell still print
# to the parent terminal.
go build -trimpath -ldflags="-s -w -H=windowsgui \
-X main.Version=dev-${SHORT_SHA} \
-X main.Commit=${SHORT_SHA} \
-X main.BuildDate=${BUILD_DATE}" \
-o bin/drover.exe ./cmd/drover
ls -la bin/
sha256sum bin/drover.exe