mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-22 21:23:02 +01:00
github team caps us at 5 concurrent macos jobs, so macos jobs queue behind each other. blacksmith has no concurrency cap and the same arm64 macos images. converted: compile macos, check-macos test, release build-macos/verify-macos, test-builds macos, release homebrew-stage. sign-macos stays on github-hosted macos-26, like sign-windows: it holds the release signing identity.
140 lines
6.1 KiB
YAML
140 lines
6.1 KiB
YAML
name: Test builds
|
|
|
|
# Downloadable, unsigned builds of dev for teammates to try: Hex Test.app
|
|
# for Apple silicon Macs, Windows x64 and ARM64 executables and installers,
|
|
# and the Linux x64 and ARM64 executables with their .deb and .rpm. Nothing is published, signed with a
|
|
# release key, or uploaded anywhere but this run's artifacts. See
|
|
# docs/test-builds.md.
|
|
on:
|
|
push:
|
|
branches: [dev]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: test-builds-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
resolve:
|
|
runs-on: ubuntu-24.04
|
|
outputs:
|
|
sha: ${{ steps.resolve.outputs.sha }}
|
|
short: ${{ steps.resolve.outputs.short }}
|
|
version: ${{ steps.resolve.outputs.version }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
with:
|
|
persist-credentials: false
|
|
- id: resolve
|
|
run: |
|
|
{
|
|
echo "sha=$(git rev-parse HEAD)"
|
|
echo "short=$(git rev-parse --short=7 HEAD)"
|
|
echo "version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "hex") | .version')"
|
|
} >> "$GITHUB_OUTPUT"
|
|
|
|
desktop:
|
|
needs: resolve
|
|
uses: ./.github/workflows/build-desktop.yml
|
|
with:
|
|
sha: ${{ needs.resolve.outputs.sha }}
|
|
version: ${{ needs.resolve.outputs.version }}
|
|
test-build: true
|
|
artifact-prefix: hex-test-${{ needs.resolve.outputs.short }}
|
|
retention-days: 14
|
|
|
|
installers:
|
|
needs: [resolve, desktop]
|
|
uses: ./.github/workflows/windows-installers.yml
|
|
with:
|
|
sha: ${{ needs.resolve.outputs.sha }}
|
|
version: ${{ needs.resolve.outputs.version }}
|
|
pattern: hex-test-${{ needs.resolve.outputs.short }}-windows-*
|
|
digests: hex-test-${{ needs.resolve.outputs.short }}-windows-x86_64=${{ needs.desktop.outputs.windows-x64-digest }} hex-test-${{ needs.resolve.outputs.short }}-windows-aarch64=${{ needs.desktop.outputs.windows-arm64-digest }}
|
|
artifact-name: hex-test-${{ needs.resolve.outputs.short }}-windows-installers
|
|
retention-days: 14
|
|
|
|
macos:
|
|
name: macOS arm64
|
|
needs: resolve
|
|
runs-on: blacksmith-6vcpu-macos-26
|
|
timeout-minutes: 90
|
|
env:
|
|
HEX_TEST_BUILD: "1"
|
|
HEX_VERSION: ${{ needs.resolve.outputs.version }}
|
|
DMG: hex-test-${{ needs.resolve.outputs.short }}-arm64.dmg
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
with:
|
|
ref: ${{ needs.resolve.outputs.sha }}
|
|
persist-credentials: false
|
|
- uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
|
|
with:
|
|
toolchain: stable
|
|
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
|
|
with:
|
|
key: test-build
|
|
cache-on-failure: true
|
|
- uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6
|
|
- name: Install the Metal toolchain
|
|
run: xcrun --sdk macosx metal --version || xcodebuild -downloadComponent MetalToolchain
|
|
- name: Build Hex Test.app
|
|
run: |
|
|
scripts/setup.sh
|
|
bundle=$(scripts/build-app.sh)
|
|
"$bundle/Contents/MacOS/hex" --version
|
|
scripts/smoke-macos-app.sh "$bundle"
|
|
mkdir -p dist/staging
|
|
/usr/bin/ditto "$bundle" "dist/staging/$(basename "$bundle")"
|
|
ln -s /Applications dist/staging/Applications
|
|
# hdiutil on the hosted runners intermittently fails (Resource busy)
|
|
# after the launch check, so it gets a few tries, with its error shown.
|
|
for attempt in 1 2 3 4 5; do
|
|
hdiutil create -fs APFS -format ULFO -volname "Hex Test" -srcfolder dist/staging "dist/$DMG" && break
|
|
[ "$attempt" -lt 5 ] || exit 1
|
|
echo "hdiutil create failed (attempt $attempt); retrying" >&2
|
|
rm -f "dist/$DMG"
|
|
sleep 10
|
|
done
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
|
|
with:
|
|
name: hex-test-${{ needs.resolve.outputs.short }}-macos-arm64
|
|
path: dist/${{ env.DMG }}
|
|
retention-days: 14
|
|
if-no-files-found: error
|
|
|
|
summary:
|
|
needs: [resolve, desktop, installers, macos]
|
|
if: ${{ !cancelled() }}
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
actions: read
|
|
steps:
|
|
- name: List the downloads
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
SHORT: ${{ needs.resolve.outputs.short }}
|
|
VERSION: ${{ needs.resolve.outputs.version }}
|
|
RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
run: |
|
|
link() {
|
|
id=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/artifacts" \
|
|
--jq ".artifacts[] | select(.name == \"hex-test-$SHORT-$1\") | .id")
|
|
if [ -n "$id" ]; then
|
|
echo "[hex-test-$SHORT-$1]($RUN/artifacts/$id)"
|
|
else
|
|
echo "hex-test-$SHORT-$1 (build failed)"
|
|
fi
|
|
}
|
|
cat >> "$GITHUB_STEP_SUMMARY" <<EOF
|
|
## Hex test builds of $SHORT (version $VERSION)
|
|
|
|
Unsigned builds for testing; they never update themselves. Sign in to GitHub to download. Kept 14 days. Full instructions: [docs/test-builds.md]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/blob/dev/docs/test-builds.md).
|
|
|
|
- **macOS (Apple silicon):** $(link macos-arm64). Quit Hex, open the DMG, drag **Hex Test** to Applications, run \`xattr -dr com.apple.quarantine "/Applications/Hex Test.app"\`, then open it and grant the permissions again.
|
|
- **Windows:** installers $(link windows-installers); bare executables x64 $(link windows-x86_64), ARM64 $(link windows-aarch64). Quit Hex from the tray, run \`hex-setup-$VERSION-windows-<x64|arm64>.exe\`, and choose More info, Run anyway at the SmartScreen warning. The bare \`hex-*.exe\` also runs without installing.
|
|
- **Linux:** x86_64 $(link linux-x86_64), ARM64 $(link linux-aarch64), each the bare executable plus a .deb and .rpm. Run \`hex quit\`, \`chmod +x hex-*-linux-<x64|arm64>\`, start it with \`./hex-*-linux-<x64|arm64> service\`, and open the window with \`./hex-*-linux-<x64|arm64>\` in another terminal.
|
|
EOF
|