Skip to content

Release

Release #16

Workflow file for this run

## This release action is inspired from https://githug.com/paradigmxyz/reth
name: Release
on:
workflow_dispatch:
inputs:
version:
required: true
type: string
push:
tags:
- v*.*.*
jobs:
extract-version:
name: extract version
runs-on: ubuntu-latest
steps:
- name: Extract version
run: |
if [ -n "${{ github.event.inputs.version }}" ]; then
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT
fi
id: extract_version
outputs:
VERSION: ${{ steps.extract_version.outputs.VERSION }}
build:
name: build release
runs-on: ${{ matrix.os }}
needs: extract-version
strategy:
matrix:
include:
- target: aarch64-unknown-linux-gnu
os: ubuntu-20.04
profile: release
- target: x86_64-unknown-linux-gnu
os: ubuntu-20.04
profile: release
- target: x86_64-apple-darwin
os: macos-latest
profile: release
- target: aarch64-apple-darwin
os: macos-latest
profile: release
- target: x86_64-pc-windows-gnu
os: ubuntu-20.04
profile: release
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
- uses: taiki-e/install-action@cross
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Foundry install
if: contains( ${{ matrix.target }}, 'apple')
uses: foundry-rs/foundry-toolchain@v1
- name: Install protobuf
if: contains( ${{ matrix.target }}, 'apple')
uses: arduino/setup-protoc@v3
# ==============================
# Apple Silicon SDK setup
# ==============================
- name: Apple Silicon setup
if: matrix.target == 'aarch64-apple-darwin'
run: |
echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV
# ==============================
# Builds
# ==============================
- name: Build rundler for ${{ matrix.target }}
run: |
sudo -E env "PATH=$PATH" make build-${{ matrix.target }}
- name: Move cross-compiled binary
run: |
mkdir artifacts
[[ "${{ matrix.target }}" == *windows* ]] && ext=".exe"
sudo mv "target/${{ matrix.target }}/${{ matrix.profile }}/rundler${ext}" ./artifacts
# ==============================
# Signing
# ==============================
- name: Configure GPG and create artifacts
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
export GPG_TTY=$(tty)
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --batch --import
cd artifacts
tar -czf rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz rundler*
echo "$GPG_PASSPHRASE" | gpg --passphrase-fd 0 --pinentry-mode loopback --batch -ab rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz
mv *tar.gz* ..
shell: bash
# =======================================================================
# Upload artifacts
# This is required to share artifacts between different jobs
# =======================================================================
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz
path: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz
- name: Upload signature
uses: actions/upload-artifact@v3
with:
name: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz.asc
path: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz.asc
draft-release:
name: draft release
needs: [build, extract-version]
runs-on: ubuntu-latest
env:
VERSION: ${{ needs.extract-version.outputs.VERSION }}
permissions:
# Required to post the release
contents: write
steps:
# This is necessary for generating the changelog. It has to come before "Download Artifacts" or else it deletes the artifacts.
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
# ==============================
# Download artifacts
# ==============================
- name: Download artifacts
uses: actions/download-artifact@v3
# ==============================
# Create release draft
# ==============================
- name: Generate full changelog
id: changelog
run: |
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
echo "$(git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 ${{ env.VERSION }}^)..${{ env.VERSION }})" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create release draft
env:
GITHUB_USER: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The formatting here is borrowed from Reth & Lighthouse (which is borrowed from OpenEthereum):
# https://github.com/openethereum/openethereum/blob/main/.github/workflows/build.yml
run: |
body=$(cat <<- "ENDBODY"
<Release Name>
## Testing Checklist (DELETE ME)
- [ ] Run on testnet for 1-3 days.
- [ ] Ensure all CI checks pass.
## Release Checklist (DELETE ME)
- [ ] Ensure all crates have had their versions bumped.
- [ ] Write the summary.
- [ ] Ensure all binaries have been added.
- [ ] Prepare release posts (Twitter, ...).
## Summary
Add a summary, including:
- Critical bug fixes
- New features
- Any breaking changes (and what to expect)
## All Changes
${{ steps.changelog.outputs.CHANGELOG }}
## Binaries
The binaries are signed with the PGP key: `85C5 DEF0 37D3 FDE4 FC17 94B1 475B 35EA 9352 EB2`
| System | Architecture | Binary | PGP Signature |
|:---:|:---:|:---:|:---|
| <img src="https://simpleicons.org/icons/linux.svg" style="width: 32px;"/> | x86_64 | [rundler-${{ env.VERSION }}-x86_64-unknown-linux-gnu.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-x86_64-unknown-linux-gnu.tar.gz) | [PGP Signature](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-x86_64-unknown-linux-gnu.tar.gz.asc) |
| <img src="https://simpleicons.org/icons/linux.svg" style="width: 32px;"/> | aarch64 | [rundler-${{ env.VERSION }}-aarch64-unknown-linux-gnu.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-aarch64-unknown-linux-gnu.tar.gz) | [PGP Signature](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-aarch64-unknown-linux-gnu.tar.gz.asc) |
| <img src="https://simpleicons.org/icons/windows.svg" style="width: 32px;"/> | x86_64 | [rundler-${{ env.VERSION }}-x86_64-pc-windows-gnu.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-x86_64-pc-windows-gnu.tar.gz) | [PGP Signature](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-x86_64-pc-windows-gnu.tar.gz.asc) |
| <img src="https://simpleicons.org/icons/apple.svg" style="width: 32px;"/> | x86_64 | [rundler-${{ env.VERSION }}-x86_64-apple-darwin.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-x86_64-apple-darwin.tar.gz) | [PGP Signature](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-x86_64-apple-darwin.tar.gz.asc) |
| <img src="https://simpleicons.org/icons/apple.svg" style="width: 32px;"/> | aarch64 | [rundler-${{ env.VERSION }}-aarch64-apple-darwin.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-aarch64-apple-darwin.tar.gz) | [PGP Signature](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/rundler-${{ env.VERSION }}-aarch64-apple-darwin.tar.gz.asc) |
| | | | |
| **System** | **Option** | - | **Resource** |
| <img src="https://simpleicons.org/icons/docker.svg" style="width: 32px;"/> | Docker | [${{ env.VERSION }}](https://hub.docker.com/r/alchemyplatform/rundler) |
ENDBODY
)
assets=()
for asset in ./rundler-*.tar.gz*; do
assets+=("-a" "$asset/$asset")
done
tag_name="${{ env.VERSION }}"
echo "$body" | gh release create --draft "${assets[@]}" -F "-" "$tag_name"