Skip to content

Commit

Permalink
Update release workflows (#417)
Browse files Browse the repository at this point in the history
The release was not being built on arm64 chip architecture for both
linux and macos. Github now supports arm64 for macos by default,
additionally we upgraded our github account to get access to a
linux arm64 runner.
  • Loading branch information
dfarr authored Sep 16, 2024
1 parent 4226d32 commit cdc27eb
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 28 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/release_publish_github_artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,30 @@ jobs:
systems:
- os: linux
arch: x86_64
arch_grep: x86-64
runner: ubuntu-22.04
- os: linux
arch: aarch64
runner: ubuntu-22.04
arch_grep: aarch64
runner: ubuntu-22.04-arm64
- os: darwin
arch: x86_64
runner: macos-12
arch_grep: x86_64
runner: macos-13
- os: darwin
arch: aarch64
runner: macos-12
arch_grep: arm64
runner: macos-14
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v13

- name: Use Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v7

- name: Build Resonate binary
run: |
TARBALL="resonate_${{ matrix.systems.os }}_${{ matrix.systems.arch }}.tar.gz"
Expand All @@ -52,6 +56,9 @@ jobs:
# Copy into root
cp ./result/bin/resonate resonate
# Verify binary
file resonate | grep "${{ matrix.systems.arch_grep }}"
# Compress binary
tar -czvf "${TARBALL}" resonate
Expand All @@ -68,6 +75,6 @@ jobs:
run: |
TARBALL="resonate_${{ matrix.systems.os }}_${{ matrix.systems.arch }}.tar.gz"
TARBALL_CHECKSUM="${TARBALL}.sha256"
gh release upload ${{ inputs.tag }} "${TARBALL}" --clobber
gh release upload ${{ inputs.tag }} "${TARBALL_CHECKSUM}" --clobber
46 changes: 24 additions & 22 deletions .github/workflows/release_verify_artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,28 @@ on:
workflow_call:
inputs:
tag:
description: 'The tag version to use for verification'
description: "The tag version to use for verification"
required: true
type: string

workflow_dispatch:
inputs:
tag:
description: 'The tag version to use for verification'
description: "The tag version to use for verification"
required: true
type: string

permissions:
contents: read
packages: read

jobs:
seed:
runs-on: ubuntu-22.04
steps:
- id: seed
name: Set random seed
run: echo seed=$RANDOM >> $GITHUB_OUTPUT
outputs:
seed: ${{ inputs.seed || steps.seed.outputs.seed }}
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
verify-github-image:
runs-on: ubuntu-22.04
needs: [seed]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -42,25 +35,34 @@ jobs:
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
# Pull the test image
docker pull ghcr.io/resonatehq/resonate:${{ inputs.tag }}
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.tag }}
# Run the test image
docker run --rm ghcr.io/resonatehq/resonate:${{ inputs.tag }} dst run --seed ${{ needs.seed.outputs.seed }} --aio-store sqlite
docker run --rm ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.tag }} dst run
verify-github-release:
runs-on: ubuntu-22.04
needs: [seed]
runs-on: ${{ matrix.systems.runner }}
strategy:
matrix:
systems:
- file: resonate_linux_x86_64.tar.gz
runner: ubuntu-22.04
- file: resonate_linux_aarch64.tar.gz
runner: ubuntu-22.04-arm64
- file: resonate_darwin_x86_64.tar.gz
runner: macos-13
- file: resonate_darwin_aarch64.tar.gz
runner: macos-14
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download and test GH release
run: |
# Download the release artifact
curl -L -O "https://github.com/resonatehq/resonate/releases/download/${{ inputs.tag }}/resonate_linux_x86_64.tar.gz"
curl -o resonate.tar.gz -L -O "https://github.com/${{ github.repository }}/releases/download/${{ inputs.tag }}/${{ matrix.systems.file }}"
# Extract the artifact
tar -xzf resonate_linux_x86_64.tar.gz
tar -xzf resonate.tar.gz
# Run the extracted artifact
./resonate dst run --seed ${{ needs.seed.outputs.seed }} --aio-store sqlite
./resonate dst run

0 comments on commit cdc27eb

Please sign in to comment.