Skip to content

Build Ark Release

Build Ark Release #410

Workflow file for this run

name: "Build Ark Release"
on:
push:
branches:
- main
workflow_dispatch:
jobs:
# Extract the current version of ARK from its Cargo.toml file.
get_version:
name: Determine ARK Version
runs-on: ubuntu-latest
outputs:
ARK_VERSION: ${{ steps.extract_version.outputs.result }}
steps:
# Checkout sources
- name: Checkout sources
uses: actions/checkout@v4
# Extract version
- name: Determine Version
id: extract_version
run: |
VERSION=$(cat crates/ark/Cargo.toml | grep '^version' | sed -e "s/[^.0-9]//g")
echo "ARK version: ${VERSION}"
echo "result=${VERSION}" >> $GITHUB_OUTPUT
# Check to see whether we have already released this version. If we have, we will skip the
# release process later on.
check_release:
name: Check for Existing Release
runs-on: ubuntu-latest
needs: [get_version]
outputs:
EXISTING_RELEASE: ${{ steps.release_flag.outputs.result }}
steps:
- name: Check for existing release tag
uses: mukunku/[email protected]
id: check_tag
with:
tag: ${{ needs.get_version.outputs.ARK_VERSION }}
- name: Set release flag
id: release_flag
run: |
echo "Existing ${{ needs.get_version.outputs.ARK_VERSION }} release: ${{steps.check_tag.outputs.exists}}"
echo "result=${{steps.check_tag.outputs.exists}}" >> $GITHUB_OUTPUT
do_release:
name: Trigger a new release
if: ${{ needs.check_release.outputs.EXISTING_RELEASE == 'false' }}
runs-on: ubuntu-latest
needs: [check_release]
steps:
- name: Dummy step
run: echo ""
# Build ARK for macOS. Both arm64 (Apple Silicon) and x64 (Intel) hosts.
build_macos:
name: Build macOS
uses: ./.github/workflows/release-macos.yml
needs: [do_release, get_version]
secrets: inherit
with:
version: ${{ needs.get_version.outputs.ARK_VERSION }}
# Uploads binaries, if we created a release
upload_release_binaries:
name: Upload Release Binaries
runs-on: macos-latest
needs: [get_version, build-macos]

Check failure on line 71 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / Build Ark Release

Invalid workflow file

The workflow is not valid. .github/workflows/release.yml (Line: 71, Col: 30): Job 'upload_release_binaries' depends on unknown job 'build-macos'.
env:
GITHUB_TOKEN: ${{ github.token }}
DEBUG_FLAG: ${{ matrix.flavor == 'debug' && '-debug' || '' }}
strategy:
max-parallel: 1
matrix:
flavor: [debug]
steps:
# Download all binaries
- name: Download macOS arm64 kernel (${{ matrix.flavor }})
uses: actions/download-artifact@v4
with:
name: ark-${{ matrix.flavor }}-darwin-arm64-archive
- name: Download macOS x64 kernel (${{ matrix.flavor}})
uses: actions/download-artifact@v4
with:
name: ark-${{ matrix.flavor }}-darwin-x64-archive
# Combine macOS binaries to a single binary with lipo
- name: Create macOS universal binary
run: |
ls -R .
# Decompress x64 builds
rm -rf x64 && mkdir x64 && pushd x64
unzip ../ark-${{ needs.get_version.outputs.ARK_VERSION }}-${{ matrix.flavor }}-darwin-x64.zip
popd
# Decompress arm64 build
rm -rf arm64 && mkdir arm64 && pushd arm64
unzip ../ark-${{ needs.get_version.outputs.ARK_VERSION }}-${{ matrix.flavor }}-darwin-arm64.zip
popd
# Create a universal binary
lipo -create x64/ark arm64/ark -output ark
# Compress and bundle licenses
ARCHIVE="$GITHUB_WORKSPACE/ark-${{ needs.get_version.outputs.ARK_VERSION }}${{ env.DEBUG_FLAG }}-darwin-universal.zip"
[ -e LICENSE ] || cp "$GITHUB_WORKSPACE/LICENSE" LICENSE
[ -e NOTICE ] || cp "$GITHUB_WORKSPACE/crates/ark/NOTICE" NOTICE
zip -Xry $ARCHIVE ark LICENSE NOTICE