Skip to content

Release

Release #22

Workflow file for this run

name: "Release"
on:
workflow_dispatch:
schedule:
- cron: '30 5 * * 1' # At 05:30 AM, only on Monday
push:
tags:
- 'release/[0-9]+.[0-9]+.[0-9]+'
jobs:
releaseBuilds:
strategy:
matrix:
include:
# macos-13 is x86
- os: "macos-13"
suffix: "x86_64-macos"
# macos-14 is arm, see https://github.com/orgs/community/discussions/102846
# "Workflows executed on this image will run exclusively on the 3 vCPU M1 runner"
- os: "macos-14"
suffix: "arm64-macos"
- os: "ubuntu-latest"
suffix: "x86_64-linux"
name: Build binary on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: build hevm
run: |
nix build .#redistributable --out-link hevm
cp ./hevm/bin/hevm ./hevm-${{ matrix.suffix }}
- uses: actions/upload-artifact@v4
with:
name: hevm-${{ matrix.suffix }}
path: ./hevm-${{ matrix.suffix }}
Upload:
needs: [releaseBuilds]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: download binaries
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: create github release & upload binaries
uses: softprops/action-gh-release@v2
# scheduled/manual runs should not create a release
if: github.event_name == 'push'
with:
fail_on_unmatched_files: true
files: |
./hevm-x86_64-linux
./hevm-x86_64-macos
./hevm-arm64-macos
- name: prepare hackage artifacts
run: |
# cabal complains if we don't do this...
nix develop --command bash -c "cabal update"
nix develop --command bash -c "cabal sdist --builddir='$RUNNER_TEMP/packages'"
nix develop --command bash -c "cabal haddock lib:hevm --builddir='$RUNNER_TEMP/docs' --haddock-for-hackage --haddock-option=--hyperlinked-source"
- name: publish to hackage
uses: haskell-actions/hackage-publish@v1
# scheduled/manual runs should not publish anything
if: github.event_name == 'push'
with:
hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }}
packagesPath: ${{ runner.temp }}/packages/sdist
docsPath: ${{ runner.temp }}/docs
publish: true