name: Build on: workflow_dispatch: # Builds the one AppImage the project ships: x86_64 Linux. Development and # testing target Fedora on Wayland; other distros are untested. jobs: appimage: runs-on: amd64 # Electron and electron-builder's AppImage tools are glibc binaries, so # the image is Debian, not Alpine. Go comes from setup-go. container: image: node:24-bookworm env: CGO_ENABLED: "0" steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version-file: go.mod cache: false - name: Cache npm downloads uses: actions/cache@v4 with: path: ~/.npm key: npm-${{ hashFiles('frontend/package-lock.json', 'desktop/package-lock.json') }} restore-keys: npm- - name: Cache Go modules and build cache uses: actions/cache@v4 with: path: | ~/go/pkg/mod ~/.cache/go-build key: go-${{ hashFiles('go.sum') }}-${{ hashFiles('**/*.go') }} restore-keys: | go-${{ hashFiles('go.sum') }}- go- - name: Cache Electron and electron-builder downloads uses: actions/cache@v4 with: path: | ~/.cache/electron ~/.cache/electron-builder key: electron-${{ hashFiles('desktop/package-lock.json') }} restore-keys: electron- - name: Install dependencies run: | npm ci --prefix frontend npm ci --prefix desktop # The shell's package version is the app's: the shell and electron-builder # read it, and build:backend stamps it into the backend. It is the commit, # since package.json's is a placeholder. - name: Set the version working-directory: desktop run: npm version --no-git-tag-version "0.0.0-$(echo "$GITHUB_SHA" | cut -c1-7)" # `npm run dist` builds the frontend into internal/server/static, the Go # backend with that UI embedded, and the shell, then packages them. - name: Build the AppImage working-directory: desktop run: npm run dist - name: Keep the AppImage uses: actions/upload-artifact@v3 with: name: zampler-appimage path: desktop/release/*.AppImage if-no-files-found: error retention-days: 1