From 8f36abf93e683f2c9280c5b63530247eaa892c17 Mon Sep 17 00:00:00 2001 From: Praveen Vikram Date: Wed, 14 Oct 2026 20:06:43 -0400 Subject: [PATCH 1/2] ci: fix release builds and make the target matrix honest The v0.42 release published with zero assets. Two separate problems. Linux builds failed outright: Package gl was not found in the pkg-config search path. wl_platform.h:27:10: fatal error: wayland-client-core.h: No such file On Ubuntu 24.04 libgl1-mesa-dev is a transitional dummy package with no files of its own, so cache-apt-pkgs-action cached nothing and gl.pc never reached the disk -- the step reported success while installing nothing. Separately, go-gl/glfw/v3.4 (via fyne v2.8) enables both X11 and Wayland by default and needs the wayland/xkbcommon headers too. Install the real packages with plain apt instead of the caching action. The matrix also never did what it claimed: the six Rust-style target triples were never backed by GOOS/GOARCH/CC, so all three ubuntu jobs emitted the same linux/amd64 glibc binary, both macos jobs the same darwin/arm64 binary, and "msvc" was MinGW. Six jobs, three distinct binaries, every one mislabeled -- v0.4 has been shipping an aarch64-unknown-linux-musl asset that cannot run on aarch64. Replace them with five runners that natively produce each target, named for what they actually are. armv7 and musl are dropped; they have no hosted runner and cgo+fyne cross-compilation needs full arm sysroots. Also: - fail-fast: false, so one platform's failure stops masking the others. The windows and macos jobs were cancelled, never actually run, which hid that the checksum step would have failed on windows anyway: it ran under pwsh, where shasum does not exist. Both steps now pin bash. - go-version-file: go.mod, replacing a hardcoded 1.23 against go.mod's 1.27 -- it only worked because GOTOOLCHAIN=auto fetched a second toolchain behind the scenes. - Drop `go install fyne.io/fyne/v2/cmd/fyne@latest`; the build never invokes the fyne CLI and assets are embedded via //go:embed. - Bump all actions to current majors, clearing the Node 20 deprecation. - Add workflow_dispatch to re-run a build without touching a release. Co-Authored-By: Claude Opus 5 --- .github/workflows/go.yml | 92 +++++++++++++++++++--------------------- .gitignore | 1 + 2 files changed, 45 insertions(+), 48 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0488e89..7c87ef6 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,79 +7,75 @@ on: branches: [ "main" ] release: types: [published] + workflow_dispatch: + +permissions: + contents: write jobs: build-release: - name: Build release Executable (${{ matrix.os }}) + name: Build release Executable (${{ matrix.target }}) runs-on: ${{ matrix.os }} strategy: + # Report every platform independently; one failure must not hide the rest. + fail-fast: false matrix: include: - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - os: ubuntu-latest - target: armv7-unknown-linux-musleabihf - - os: ubuntu-latest - target: aarch64-unknown-linux-musl - - os: macos-latest - target: x86_64-apple-darwin + - os: ubuntu-24.04 + target: linux-amd64 + - os: ubuntu-24.04-arm + target: linux-arm64 - os: macos-latest - target: aarch64-apple-darwin + target: darwin-arm64 + - os: macos-15-intel + target: darwin-amd64 - os: windows-latest - target: x86_64-pc-windows-msvc + target: windows-amd64 + ext: .exe env: - BINARY_EXTENSION: ${{ endsWith(matrix.target, '-msvc') && '.exe' || '' }} - PATH_BINARY: ${{ github.workspace }}/target/${{ matrix.TARGET }}/release/simple-file-server${{ matrix.EXTENSION }}${{ endsWith(matrix.target, '-msvc') && '.exe' || '' }} + # Target-prefixed so artifact names, release asset names and the file + # basename are all one string and cannot collide across jobs. + BIN: ${{ matrix.target }}-simple-file-server${{ matrix.ext }} steps: - - uses: actions/checkout@v4 - + - uses: actions/checkout@v7 + - name: Install deps for linux build - if: ${{ matrix.os == 'ubuntu-latest' }} - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: gcc libgl1-mesa-dev xorg-dev - version: 1.0 + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + gcc libgl-dev libglvnd-dev xorg-dev \ + libwayland-dev libxkbcommon-dev wayland-protocols - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v7 with: - go-version: '1.23' + go-version-file: go.mod - name: Build + shell: bash run: | - go install fyne.io/fyne/v2/cmd/fyne@latest - go build -v -o ${{ env.PATH_BINARY }} ./cmd/... + mkdir -p dist + go build -v -trimpath -o "dist/$BIN" ./cmd/... - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.target }}-simple-file-server${{ env.BINARY_EXTENSION }} - path: ${{ env.PATH_BINARY }} - - name: Evaluate shasum - run: echo -n $(shasum -ba 256 ${{ env.PATH_BINARY }} | cut -d " " -f 1) > ${{ env.PATH_BINARY }}.sha256 - - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.target }}-simple-file-server.sha256 - path: ${{ env.PATH_BINARY }}.sha256 + shell: bash + run: shasum -ba 256 "dist/$BIN" | cut -d " " -f 1 > "dist/$BIN.sha256" - - name: '[Optional] Publish Artifact' - if: ${{ github.event_name == 'release' }} - uses: svenstaro/upload-release-action@v2 + - uses: actions/upload-artifact@v7 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ env.PATH_BINARY }} - asset_name: ${{ matrix.target }}-simple-file-server${{ env.BINARY_EXTENSION }} - tag: ${{ github.ref }} - overwrite: true - - - name: '[Optional] Publish Artifact (shasum)' + name: ${{ matrix.target }} + path: dist/* + if-no-files-found: error + + - name: '[Optional] Publish Artifacts' if: ${{ github.event_name == 'release' }} - uses: svenstaro/upload-release-action@v2 + uses: svenstaro/upload-release-action@2.11.5 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ env.PATH_BINARY }}.sha256 - asset_name: ${{ matrix.target }}-simple-file-server${{ env.BINARY_EXTENSION }}.sha256 + file: dist/* + file_glob: true tag: ${{ github.ref }} overwrite: true + check_duplicates: false diff --git a/.gitignore b/.gitignore index 79994e3..bf204f8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ bin/ logs/ deploy/ configs/config-dev.toml +dist/ From e7238b099dd50f4379a5e041d818fe8f11152565 Mon Sep 17 00:00:00 2001 From: Praveen Vikram Date: Wed, 14 Oct 2026 20:15:41 -0400 Subject: [PATCH 2/2] ci: use a portable checksum command The first matrix run with fail-fast disabled surfaced what the old cancel-on-first-failure had been hiding: the windows build itself is fine, but the checksum step died with shasum: command not found (exit 127) git-bash on windows-latest ships neither shasum nor, assume, sha256sum, and macos ships only shasum. Try each in turn and fall back to certutil, which is always present on windows. Echo the digest so the value is visible in the log. Co-Authored-By: Claude Opus 5 --- .github/workflows/go.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7c87ef6..699ce39 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -59,9 +59,21 @@ jobs: mkdir -p dist go build -v -trimpath -o "dist/$BIN" ./cmd/... + # No single checksum tool exists on all three runners: linux has + # sha256sum, macos only has shasum, and git-bash on windows has + # neither, so fall back to certutil there. - name: Evaluate shasum shell: bash - run: shasum -ba 256 "dist/$BIN" | cut -d " " -f 1 > "dist/$BIN.sha256" + working-directory: dist + run: | + if command -v sha256sum >/dev/null 2>&1; then + sha256sum "$BIN" | cut -d " " -f 1 > "$BIN.sha256" + elif command -v shasum >/dev/null 2>&1; then + shasum -ba 256 "$BIN" | cut -d " " -f 1 > "$BIN.sha256" + else + certutil -hashfile "$BIN" SHA256 | sed -n 2p | tr -d '[:space:]' > "$BIN.sha256" + fi + cat "$BIN.sha256" - uses: actions/upload-artifact@v7 with: