From 207749a86bc1ee6a7de8637dd57c72acb19e2a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Thu, 26 Oct 2023 12:33:27 -0300 Subject: [PATCH] Add release workflow --- .github/workflows/release.yml | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..1b4649c6a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,59 @@ +name: "Release" +on: + push: + tags: + - "v.*" + +jobs: + nixBuild: + name: Build ${{ matrix.name }} binary + runs-on: ${{ matrix.os }} + permissions: + contents: read + strategy: + matrix: + include: + - os: ubuntu-latest + name: Linux (x86_64) + tuple: x86_64-linux + - os: macos-latest + name: macOS (x86_64) + tuple: x86_64-macos + - os: macos-latest-xlarge + name: macOS (aarch64) + tuple: aarch64-macos + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Nix + uses: cachix/install-nix-action@v23 + with: + nix_path: nixpkgs=channel:nixos-unstable + - name: Build redistributable echidna + run: | + nix build .#echidna-redistributable --out-link redistributable + tar -czf "echidna-${{ matrix.tuple }}.tar.gz" -C ./redistributable/bin/ echidna + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: echidna-release + path: echidna-${{ matrix.tuple }}.tar.gz + release: + name: Create release + needs: [nixBuild] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Download binaries + uses: actions/download-artifact@v3 + with: + name: echidna-release + - name: Create GitHub release and upload binaries + uses: softprops/action-gh-release@v0.1.15 + with: + draft: true + files: | + ./echidna-*.tar.gz