A shepherd for your Appimages.
0

Configure Feed

Select the types of activity you want to include in your feed.

ci: build appimages with nix

Aly Raffauf (Jun 20, 2026, 10:18 AM EDT) 4ba11af3 55d6ac65

+73 -41
+54 -26
.github/workflows/release.yml
··· 15 15 - name: Check out repository 16 16 uses: actions/checkout@v5 17 17 18 - - name: Set up Go 19 - uses: actions/setup-go@v6 20 - with: 21 - go-version-file: go.mod 18 + - name: Set up Nix 19 + uses: DeterminateSystems/nix-installer-action@main 22 20 23 21 - name: Install release tools 24 - run: sudo apt-get update -qq && sudo apt-get install -y -qq zsync 22 + run: sudo apt-get update -qq && sudo apt-get install -y -qq binutils zsync 25 23 26 - - name: Build AppDir 24 + - name: Build release payload 27 25 run: | 26 + set -euo pipefail 27 + 28 + export APPHERDER_RELEASE_VERSION="$GITHUB_REF_NAME" 29 + export APPHERDER_RELEASE_SYSTEM="x86_64-linux" 30 + 31 + nix build --impure --out-link result-appherder --expr ' 32 + let 33 + flake = builtins.getFlake (toString ./.); 34 + pkgs = import flake.inputs.nixpkgs { 35 + system = builtins.getEnv "APPHERDER_RELEASE_SYSTEM"; 36 + config.allowUnfree = true; 37 + }; 38 + in 39 + pkgs.callPackage ./package.nix { 40 + version = builtins.getEnv "APPHERDER_RELEASE_VERSION"; 41 + } 42 + ' 43 + 28 44 mkdir -p AppDir/usr/bin 29 45 30 - # Binary with tagged version 31 - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ 32 - go build -trimpath \ 33 - -ldflags "-s -w -X main.version=$GITHUB_REF_NAME" \ 34 - -o AppDir/usr/bin/appherder ./cmd/appherder 46 + # Copy the real Go binary, not the Nix PATH wrapper. 47 + if [ -x result-appherder/bin/.appherder-wrapped ]; then 48 + install -Dm755 result-appherder/bin/.appherder-wrapped AppDir/usr/bin/appherder 49 + install -Dm755 result-appherder/bin/.appherder-wrapped appherder-linux-amd64 50 + else 51 + install -Dm755 result-appherder/bin/appherder AppDir/usr/bin/appherder 52 + install -Dm755 result-appherder/bin/appherder appherder-linux-amd64 53 + fi 54 + 55 + ./appherder-linux-amd64 --version | grep -F "appherder version $GITHUB_REF_NAME" 35 56 36 57 # Bundle dwarfsextract so DwarFS AppImages do not need host tools. 37 - DWARFS_VERSION=0.14.0 38 - DWARFS_DIR="dwarfs-$DWARFS_VERSION-Linux-x86_64" 39 - wget -q -O /tmp/dwarfs.tar.xz \ 40 - "https://github.com/mhx/dwarfs/releases/download/v$DWARFS_VERSION/$DWARFS_DIR.tar.xz" 41 - tar -xf /tmp/dwarfs.tar.xz -C /tmp 42 - install -Dm755 "/tmp/$DWARFS_DIR/bin/dwarfsextract" AppDir/usr/bin/dwarfsextract 58 + nix build --impure --out-link result-dwarfs --expr ' 59 + let 60 + flake = builtins.getFlake (toString ./.); 61 + pkgs = import flake.inputs.nixpkgs { 62 + system = builtins.getEnv "APPHERDER_RELEASE_SYSTEM"; 63 + config.allowUnfree = true; 64 + }; 65 + in 66 + pkgs.dwarfs 67 + ' 68 + install -Dm755 result-dwarfs/bin/dwarfsextract AppDir/usr/bin/dwarfsextract 43 69 test "$(PATH="$PWD/AppDir/usr/bin:$PATH" command -v dwarfsextract)" = "$PWD/AppDir/usr/bin/dwarfsextract" 44 70 AppDir/usr/bin/dwarfsextract --help >/dev/null 45 71 ··· 86 112 87 113 chmod +x AppDir/AppRun 88 114 89 - - name: Build plain binary 90 - run: | 91 - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ 92 - go build -trimpath \ 93 - -ldflags "-s -w -X main.version=$GITHUB_REF_NAME" \ 94 - -o appherder-linux-amd64 ./cmd/appherder 95 - 96 115 - name: Build AppImage 97 116 run: | 117 + set -euo pipefail 118 + 98 119 APPIMAGE="appherder-$GITHUB_REF_NAME-x86_64.AppImage" 120 + UPDATE_INFO="gh-releases-zsync|alyraffauf|appherder|latest|appherder-*x86_64.AppImage.zsync" 121 + 99 122 wget -q -O /tmp/appimagetool.AppImage \ 100 123 https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage 101 124 chmod +x /tmp/appimagetool.AppImage 102 - /tmp/appimagetool.AppImage \ 103 - -u "gh-releases-zsync|alyraffauf|appherder|latest|appherder-*x86_64.AppImage.zsync" \ 125 + 126 + APPIMAGE_EXTRACT_AND_RUN=1 /tmp/appimagetool.AppImage \ 127 + -u "$UPDATE_INFO" \ 104 128 AppDir "$APPIMAGE" 129 + 130 + test -f "$APPIMAGE" 131 + test -f "$APPIMAGE.zsync" 132 + readelf -p .upd_info "$APPIMAGE" | grep -F "$UPDATE_INFO" 105 133 106 134 - name: Publish release 107 135 env:
+19 -15
package.nix
··· 3 3 dwarfs, 4 4 lib, 5 5 makeWrapper, 6 - }: let 7 - version = "dev"; 8 - in 9 - buildGoModule { 10 - pname = "appherder"; 11 - inherit version; 12 - src = ./.; 13 - vendorHash = "sha256-hrqRutMJw96V61AKoyt4Oqya8STeGYlF5phb6O35L8Q="; 14 - subPackages = ["cmd/appherder"]; 15 - ldflags = ["-X main.version=${version}"]; 16 - nativeBuildInputs = [makeWrapper]; 17 - postInstall = '' 18 - wrapProgram $out/bin/appherder --prefix PATH : ${lib.makeBinPath [dwarfs]} 19 - ''; 20 - } 6 + version ? "dev", 7 + }: 8 + buildGoModule { 9 + pname = "appherder"; 10 + inherit version; 11 + src = ./.; 12 + vendorHash = "sha256-hrqRutMJw96V61AKoyt4Oqya8STeGYlF5phb6O35L8Q="; 13 + subPackages = ["cmd/appherder"]; 14 + env.CGO_ENABLED = "0"; 15 + ldflags = [ 16 + "-s" 17 + "-w" 18 + "-X main.version=${version}" 19 + ]; 20 + nativeBuildInputs = [makeWrapper]; 21 + postInstall = '' 22 + wrapProgram $out/bin/appherder --prefix PATH : ${lib.makeBinPath [dwarfs]} 23 + ''; 24 + }