From 350470c055f99d991d1ba1a7bd992d3707b1751e Mon Sep 17 00:00:00 2001 From: "Paul H. Liu" Date: Sun, 4 Jul 2021 02:49:17 -0700 Subject: [PATCH] Build binary release on CI --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ default.nix | 5 ++--- 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1c07981 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: "release" + +on: + release: + types: [created] + +jobs: + release: + name: "Release" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.4 + - uses: cachix/install-nix-action@v13 + with: + nix_path: nixpkgs=channel:nixos-21.05 + - uses: cachix/cachix-action@v10 + with: + name: ninegua + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix-build + - run: export name=ic-utils-$(echo ${{ github.ref }} | cut -d/ -f3) && tar -zcv -C result/ --transform "s,^.,$name," -f $name-linux-x86_64.tar.gz . + - name: Upload release package + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref }} + file: ic-utils-*.tar.gz + file_glob: true diff --git a/default.nix b/default.nix index 40a7c01..da91407 100644 --- a/default.nix +++ b/default.nix @@ -43,9 +43,8 @@ let in !(baseName == "dist-newstyle" || lib.hasSuffix ".vim" baseName) && lib.sources.cleanSourceFilter name type; cleanSource = src: lib.sources.cleanSourceWith { inherit filter src; }; -in with pkgs; -stdenv.mkDerivation { - name = "ic-util"; +in stdenv.mkDerivation { + name = "ic-utils"; version = "0.1.0-pre"; phases = [ "installPhase" ]; installPhase = ''