Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
elopez committed Oct 26, 2023
1 parent 4924186 commit b9de173
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: "Release"
on:
push:
tags:
- "v*"

jobs:
nixBuild:
name: Build ${{ matrix.name }} binary
runs-on: ${{ matrix.os }}
permissions:
contents: read
outputs:
version: ${{ steps.version.outputs.version }}
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: DeterminateSystems/nix-installer-action@v6
- name: Configure Nix cache
if: runner.arch == 'X64'
# Unfortunately the action does not work on ARM runners
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Build redistributable echidna
run: |
nix build .#echidna-redistributable --out-link redistributable
tar -czf "echidna-${{ matrix.tuple }}.tar.gz" -C ./redistributable/bin/ echidna
- name: Obtain version number
id: version
run: |
echo "version=$(echo "$GIT_REF" | sed 's#^refs/tags/v##')" >> "$GITHUB_OUTPUT"
env:
GIT_REF: ${{ github.ref }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: echidna-release
path: echidna-${{ steps.version.outputs.version }}-${{ 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/[email protected]
with:
draft: true
name: "Echidna ${{ needs.nixBuild.outputs.version }}"
files: |
./echidna-*.tar.gz

0 comments on commit b9de173

Please sign in to comment.