From d1d5ac8f982f0a964b66a621428278d952a3391c Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sat, 3 Oct 2026 20:15:22 +0200 Subject: [PATCH] Upload raw executables in release.yml instead of zip/tar.gz build-go and build-gui now build straight to their final release filename (e.g. dist/Completed-api_linux_amd64, dist/Completed-gui_windows_amd64.exe) and upload-artifact uploads that directly - no separate Archive step, no zip/tar.gz wrapping a single or paired executable. build-web stays archived: it's not an executable, it's the built Angular site (a directory of HTML/JS/CSS/asset files), so bundling it into one tar.gz is still the right call there. Trade-off worth knowing: a raw upload doesn't preserve the Unix executable bit the way tar.gz did, so linux/darwin downloads need `chmod +x` before running; .exe downloads are unaffected. Documented in release.yml's comments. The release job's download/upload loop needed no changes - it already walks whatever's under artifacts/ with `find -type f`, regardless of how many raw files land in a given artifact's subdirectory. Co-Authored-By: Claude Sonnet 5 --- .gitea/workflows/release.yml | 44 ++++++++++++++---------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 1e49fac..fb9150c 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -41,6 +41,12 @@ jobs: with: go-version-file: go.mod + # Built with their final release filenames directly (rather than a + # generic name plus a separate archive step), so what comes out of + # dist/ is exactly what gets uploaded: raw executables, no zip/tar.gz. + # One real trade-off: a raw upload doesn't preserve the Unix + # executable bit the way a tar.gz would, so linux/darwin downloads + # need a manual `chmod +x` before running; .exe is unaffected. - name: Build api and tui env: GOOS: ${{ matrix.goos }} @@ -50,23 +56,14 @@ jobs: mkdir -p dist ext="" if [ "${{ matrix.goos }}" = "windows" ]; then ext=".exe"; fi - go build -o "dist/completed-api${ext}" ./cmd/api - go build -o "dist/completed-tui${ext}" ./cmd/tui - - - name: Archive - run: | - cd dist - base="${PROJECT_NAME}_${{ matrix.goos }}_${{ matrix.goarch }}" - if [ "${{ matrix.goos }}" = "windows" ]; then - zip "../${base}.zip" completed-api.exe completed-tui.exe - else - tar czf "../${base}.tar.gz" completed-api completed-tui - fi + suffix="${{ matrix.goos }}_${{ matrix.goarch }}${ext}" + go build -o "dist/${PROJECT_NAME}-api_${suffix}" ./cmd/api + go build -o "dist/${PROJECT_NAME}-tui_${suffix}" ./cmd/tui - uses: actions/upload-artifact@v3 with: - name: ${{ env.PROJECT_NAME }}_${{ matrix.goos }}_${{ matrix.goarch }} - path: ${{ env.PROJECT_NAME }}_${{ matrix.goos }}_${{ matrix.goarch }}.* + name: ${{ env.PROJECT_NAME }}-go_${{ matrix.goos }}_${{ matrix.goarch }} + path: dist/* retention-days: 7 # cmd/gui (Fyne) uses cgo, so unlike build-go above it can't just cross- @@ -100,6 +97,8 @@ jobs: sudo apt-get update sudo apt-get install -y ${{ matrix.packages }} + # Same reasoning as build-go above: upload the raw executable, built + # with its final release name directly, no archive step. - name: Build gui env: GOOS: ${{ matrix.goos }} @@ -107,26 +106,17 @@ jobs: CGO_ENABLED: "1" run: | mkdir -p dist + name="dist/${PROJECT_NAME}-gui_${{ matrix.goos }}_${{ matrix.goarch }}" if [ "${{ matrix.goos }}" = "windows" ]; then - CC=x86_64-w64-mingw32-gcc go build -ldflags "-H=windowsgui" -o dist/completed-gui.exe ./cmd/gui + CC=x86_64-w64-mingw32-gcc go build -ldflags "-H=windowsgui" -o "${name}.exe" ./cmd/gui else - go build -o dist/completed-gui ./cmd/gui - fi - - - name: Archive - run: | - cd dist - base="../${PROJECT_NAME}-gui_${{ matrix.goos }}_${{ matrix.goarch }}" - if [ "${{ matrix.goos }}" = "windows" ]; then - zip "${base}.zip" completed-gui.exe - else - tar czf "${base}.tar.gz" completed-gui + go build -o "${name}" ./cmd/gui fi - uses: actions/upload-artifact@v3 with: name: ${{ env.PROJECT_NAME }}-gui_${{ matrix.goos }}_${{ matrix.goarch }} - path: ${{ env.PROJECT_NAME }}-gui_${{ matrix.goos }}_${{ matrix.goarch }}.* + path: dist/* retention-days: 7 build-web: