clone

an offline map explorer where each world, from a game map to a city's open data, ships as one .atlas file

feat: builds that hold steady, and a way to cut a release

Dami committed 8aa5e19
One workflow, four jobs. Every pull request and push to main proves the
application still builds for Windows x64, macOS Apple Silicon, and
Linux x64, and that the committed frontend assets match what esbuild
would produce today. A tag matching v* runs the same builds and
publishes them as a GitHub release -- the Windows exe zipped, the Linux
binary tarred, the Mac binary dressed as an unsigned Atlas.app and
archived with ditto so its bits survive the trip.

Windows cross-compiles from the Linux runner because the Wails Windows
frontend is pure Go; Linux builds against WebKitGTK 4.1 on a pinned
ubuntu-24.04 so the runtime dependency never shifts silently; macOS
builds on a pinned arm64 image. The release job is the only one allowed
to write, and only on tags. Nothing here runs go generate: bundles are
data, and the executable travels alone.
commit
8aa5e198c00e4b8dcc7ccabd8d80f8e5821be47b
parent
0c2f370863f02eec60086de7e5ee837ca9a0a514
author
Dami <dami.etoile@gmail.com>
2 files changed, +163 -0
A.github/workflows/ci.yml150++++++++++++++++++++++++++++++
MREADME.md13+++
A .github/workflows/ci.yml +150 -0
@@ -0,0 +1,150 @@
1+name: CI2+3+on:4+ push:5+ branches: [main]6+ tags: ["v*"]7+ pull_request:8+9+permissions:10+ contents: read11+12+concurrency:13+ group: ci-${{ github.ref }}14+ cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}15+16+env:17+ GOFLAGS: -trimpath -buildvcs=false18+19+jobs:20+ checks:21+ runs-on: ubuntu-24.0422+ steps:23+ - uses: actions/checkout@v524+ - uses: actions/setup-go@v525+ with:26+ go-version-file: go.mod27+ - uses: actions/setup-node@v428+ with:29+ node-version: 2430+ cache: npm31+ cache-dependency-path: frontend/package-lock.json32+ - name: Rebuild frontend and confirm committed assets match33+ run: |34+ npm --prefix frontend ci35+ npm --prefix frontend run build36+ git diff --exit-code -- assets/37+ test -z "$(git status --porcelain assets/)"38+ - name: Install GTK and WebKitGTK headers39+ run: |40+ sudo apt-get update41+ sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev42+ - name: Vet and test43+ run: |44+ go vet -tags "desktop,production,webkit2_41" ./...45+ go test -tags "desktop,production,webkit2_41" ./...46+47+ build-linux:48+ runs-on: ubuntu-24.0449+ steps:50+ - uses: actions/checkout@v551+ - uses: actions/setup-go@v552+ with:53+ go-version-file: go.mod54+ - name: Install GTK and WebKitGTK headers55+ run: |56+ sudo apt-get update57+ sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev58+ - name: Build59+ run: |60+ VERSION="${GITHUB_REF_NAME}"61+ [[ "${GITHUB_REF}" == refs/tags/v* ]] || VERSION="dev-$(git rev-parse --short HEAD)"62+ go build -tags "desktop,production,webkit2_41" -ldflags "-w -s" -o Atlas .63+ tar -czf "Atlas-${VERSION}-linux-amd64.tar.gz" Atlas64+ - uses: actions/upload-artifact@v465+ with:66+ name: atlas-linux-amd6467+ path: Atlas-*-linux-amd64.tar.gz68+ if-no-files-found: error69+70+ build-windows:71+ runs-on: ubuntu-24.0472+ steps:73+ - uses: actions/checkout@v574+ - uses: actions/setup-go@v575+ with:76+ go-version-file: go.mod77+ - name: Cross-compile for Windows78+ env:79+ GOOS: windows80+ GOARCH: amd6481+ CGO_ENABLED: "0"82+ run: |83+ VERSION="${GITHUB_REF_NAME}"84+ [[ "${GITHUB_REF}" == refs/tags/v* ]] || VERSION="dev-$(git rev-parse --short HEAD)"85+ go build -tags "desktop,production" -ldflags "-w -s -H windowsgui" -o Atlas.exe .86+ zip "Atlas-${VERSION}-windows-amd64.zip" Atlas.exe87+ - uses: actions/upload-artifact@v488+ with:89+ name: atlas-windows-amd6490+ path: Atlas-*-windows-amd64.zip91+ if-no-files-found: error92+93+ build-macos:94+ runs-on: macos-1595+ steps:96+ - uses: actions/checkout@v597+ - uses: actions/setup-go@v598+ with:99+ go-version-file: go.mod100+ - name: Build and assemble Atlas.app101+ run: |102+ VERSION="${GITHUB_REF_NAME}"103+ [[ "${GITHUB_REF}" == refs/tags/v* ]] || VERSION="dev-$(git rev-parse --short HEAD)"104+ go build -tags "desktop,production" -ldflags "-w -s" -o Atlas .105+ mkdir -p Atlas.app/Contents/MacOS106+ cp Atlas Atlas.app/Contents/MacOS/Atlas107+ cat > Atlas.app/Contents/Info.plist <<EOF108+ <?xml version="1.0" encoding="UTF-8"?>109+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">110+ <plist version="1.0">111+ <dict>112+ <key>CFBundleExecutable</key><string>Atlas</string>113+ <key>CFBundleIdentifier</key><string>dev.felinestatemachine.atlas</string>114+ <key>CFBundleName</key><string>Atlas</string>115+ <key>CFBundlePackageType</key><string>APPL</string>116+ <key>CFBundleInfoDictionaryVersion</key><string>6.0</string>117+ <key>CFBundleShortVersionString</key><string>${VERSION#v}</string>118+ <key>LSMinimumSystemVersion</key><string>12.0</string>119+ <key>NSHighResolutionCapable</key><true/>120+ </dict>121+ </plist>122+ EOF123+ ditto -c -k --keepParent Atlas.app "Atlas-${VERSION}-darwin-arm64.zip"124+ - uses: actions/upload-artifact@v4125+ with:126+ name: atlas-darwin-arm64127+ path: Atlas-*-darwin-arm64.zip128+ if-no-files-found: error129+130+ release:131+ if: startsWith(github.ref, 'refs/tags/v')132+ needs: [checks, build-linux, build-windows, build-macos]133+ runs-on: ubuntu-latest134+ permissions:135+ contents: write136+ steps:137+ - uses: actions/checkout@v5138+ - uses: actions/download-artifact@v4139+ with:140+ path: dist141+ merge-multiple: true142+ - name: Create GitHub Release143+ env:144+ GH_TOKEN: ${{ github.token }}145+ run: |146+ PRERELEASE=""147+ [[ "${GITHUB_REF_NAME}" == *-* ]] && PRERELEASE="--prerelease"148+ gh release create "${GITHUB_REF_NAME}" dist/* \149+ --title "Atlas ${GITHUB_REF_NAME}" \150+ --generate-notes --verify-tag ${PRERELEASE}
M README.md +13 -0