diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 6dfde83..3a8e3d0 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -20,23 +20,3 @@ jobs: diagnostic-endpoint: "" - name: Run `nix build` run: nix flake check -L - nix-bundle: - runs-on: ubuntu-latest - # Only run on "v*" tagged commits - if: startsWith(github.event.ref, 'refs/tags/v') - needs: [nix-build] - steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v24 - - uses: DeterminateSystems/magic-nix-cache-action@v2 - with: - diagnostic-endpoint: "" - - name: Run `nix bundle` - run: | - nix bundle --out-link wetest-bundle-link - cp --dereference wetest-bundle-link wetest-bundle - - name: 'Upload bundle' - uses: actions/upload-artifact@v3 - with: - name: wetest-bundle - path: wetest-bundle diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a823236 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: "Release artifacts" + +permissions: read-all + +on: + # Allows running this workflow manually + workflow_dispatch: + push: + tags: + - "v*.*" + +jobs: + appimage: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v24 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + with: + diagnostic-endpoint: "" + - name: Build AppImage + id: build-appimage + run: | + nix build -L '.#AppImage' + result_path="$(realpath result)" + cp --dereference result "${result_path#*-}" + - name: Upload AppImage + uses: actions/upload-artifact@v3 + with: + name: AppImage + path: | + *.AppImage diff --git a/flake.lock b/flake.lock index 7c28c5a..e2cad68 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "appimage-runtime": { + "flake": false, + "locked": { + "lastModified": 1652289700, + "narHash": "sha256-uxQBDy/JA7uEboTOUmGaZ2FAKY/0dQ9c0A0N8+J+a7I=", + "owner": "AppImageCrafters", + "repo": "appimage-runtime", + "rev": "6500a1ef68e039caba2ebab1c7ed74c2ea9e67a5", + "type": "github" + }, + "original": { + "owner": "AppImageCrafters", + "repo": "appimage-runtime", + "type": "github" + } + }, "bash-lib": { "inputs": { "flake-utils": "flake-utils", @@ -56,6 +72,22 @@ "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1634851050, @@ -104,6 +136,45 @@ "type": "github" } }, + "flake-utils_4": { + "locked": { + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nix-appimage": { + "inputs": { + "appimage-runtime": "appimage-runtime", + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_4", + "nixpkgs": [ + "nixpkgs" + ], + "squashfuse": "squashfuse" + }, + "locked": { + "lastModified": 1695276866, + "narHash": "sha256-/BBbYIoDhIPcVwhvau/g4lzrjTnudeRLW5qaTu7LAVs=", + "owner": "ralismark", + "repo": "nix-appimage", + "rev": "17dd6001ec228ea0b8505d6904fc5796d3de5012", + "type": "github" + }, + "original": { + "owner": "ralismark", + "repo": "nix-appimage", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1694499547, @@ -141,9 +212,26 @@ "epnix": "epnix", "flake-compat": "flake-compat", "flake-utils": "flake-utils_3", + "nix-appimage": "nix-appimage", "nixpkgs": "nixpkgs_2" } }, + "squashfuse": { + "flake": false, + "locked": { + "lastModified": 1655253282, + "narHash": "sha256-RIhDXzpmrYUOwj5OYzjWKJw0cwE+L3t/9pIkg/hFXA0=", + "owner": "vasi", + "repo": "squashfuse", + "rev": "d1d7ddafb765098b34239eacaf2f9abee1fbc27c", + "type": "github" + }, + "original": { + "owner": "vasi", + "repo": "squashfuse", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index 5b099c3..42d0925 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,10 @@ flake-utils.url = "github:numtide/flake-utils"; epnix.url = "github:epics-extensions/EPNix"; flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"; + nix-appimage = { + url = "github:ralismark/nix-appimage"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { @@ -14,6 +18,7 @@ flake-utils, epnix, flake-compat, + nix-appimage, }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { @@ -69,6 +74,8 @@ }; }; + packages.AppImage = nix-appimage.bundlers.${system}.default self.packages.${system}.default; + devShells.default = pkgs.mkShell { nativeBuildInputs = with pkgs; [poetry python39Full]; };