Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 123 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
contents: write

jobs:
release:
cli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -18,7 +18,7 @@ jobs:
bun-version: 1.3.14
- run: bun install
- run: bun run build:single-exe:all
- name: Package release artifacts
- name: Package CLI release artifacts
run: |
cd cli/dist-exe
mkdir -p ../release-artifacts
Expand All @@ -35,8 +35,123 @@ jobs:
tar -czvf "../release-artifacts/${name}.tar.gz" -C "$target" hapi
fi
done
- name: Upload CLI release artifacts
uses: actions/upload-artifact@v4
with:
name: cli-release-artifacts
path: cli/release-artifacts/*
if-no-files-found: error

desktop-windows:
needs: cli
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- run: bun install
- name: Download CLI release artifacts
uses: actions/download-artifact@v4
with:
name: cli-release-artifacts
path: cli-release-artifacts
- name: Bundle release CLI for Windows desktop
shell: pwsh
run: |
New-Item -ItemType Directory -Force desktop/resources/hapi-cli/win | Out-Null
Expand-Archive -LiteralPath "cli-release-artifacts/hapi-win32-x64.zip" -DestinationPath "desktop/resources/hapi-cli/win" -Force
if (-not (Test-Path -LiteralPath "desktop/resources/hapi-cli/win/hapi.exe")) {
throw "Bundled Windows CLI artifact not found."
}
- run: cd desktop && bun run sync:release-version && bun run package:win:prebundled
- name: Package Windows desktop release artifact
shell: pwsh
run: |
New-Item -ItemType Directory -Force desktop/release-artifacts | Out-Null
if (-not (Test-Path -LiteralPath "desktop/release/win-unpacked/HAPI Desktop.exe")) {
throw "Windows desktop executable not found."
}
$portable = Get-ChildItem -LiteralPath "desktop/release" -Filter "HAPI Desktop *.exe" -File | Select-Object -First 1
if (-not $portable) {
throw "Windows desktop portable executable not found."
}
Compress-Archive -LiteralPath "desktop/release/win-unpacked" -DestinationPath "desktop/release-artifacts/hapi-desktop-win32-x64.zip" -Force
Copy-Item -LiteralPath $portable.FullName -Destination "desktop/release-artifacts/hapi-desktop-win32-x64-portable.exe" -Force
- name: Upload Windows desktop release artifact
uses: actions/upload-artifact@v4
with:
name: desktop-windows-release-artifacts
path: desktop/release-artifacts/*
if-no-files-found: error

desktop-macos:
needs: cli
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- run: bun install
- name: Download CLI release artifacts
uses: actions/download-artifact@v4
with:
name: cli-release-artifacts
path: cli-release-artifacts
- name: Bundle release CLI for macOS desktop
run: |
arch="$(uname -m)"
case "$arch" in
arm64) desktop_arch="arm64" ;;
x86_64) desktop_arch="x64" ;;
*) desktop_arch="$arch" ;;
esac
mkdir -p desktop/resources/hapi-cli/mac
tar -xzf "cli-release-artifacts/hapi-darwin-${desktop_arch}.tar.gz" -C desktop/resources/hapi-cli/mac
chmod +x desktop/resources/hapi-cli/mac/hapi
test -x desktop/resources/hapi-cli/mac/hapi
- run: cd desktop && bun run sync:release-version && bun run package:mac:prebundled
- name: Package macOS desktop release artifact
run: |
mkdir -p desktop/release-artifacts
app_path="$(find desktop/release -type d -name 'HAPI Desktop.app' -print -quit)"
if [[ -z "$app_path" ]]; then
echo "macOS desktop app not found." >&2
exit 1
fi
arch="$(uname -m)"
case "$arch" in
arm64) desktop_arch="arm64" ;;
x86_64) desktop_arch="x64" ;;
*) desktop_arch="$arch" ;;
esac
ditto -c -k --sequesterRsrc --keepParent \
"$app_path" \
"desktop/release-artifacts/hapi-desktop-darwin-${desktop_arch}.zip"
- name: Upload macOS desktop release artifact
uses: actions/upload-artifact@v4
with:
name: desktop-macos-release-artifacts
path: desktop/release-artifacts/*
if-no-files-found: error

cd ../release-artifacts
release:
runs-on: ubuntu-latest
needs:
- cli
- desktop-windows
- desktop-macos
steps:
- uses: actions/checkout@v4
- name: Download release artifacts
uses: actions/download-artifact@v4
with:
path: release-artifacts
merge-multiple: true
- name: Generate checksums
run: |
cd release-artifacts
sha256sum * > checksums.txt
- name: Create Release
env:
Expand All @@ -45,7 +160,11 @@ jobs:
gh release create "${GITHUB_REF#refs/tags/}" \
--title "Release ${GITHUB_REF#refs/tags/}" \
--generate-notes \
cli/release-artifacts/*
release-artifacts/*
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- run: bun install
- name: Update Homebrew formula
continue-on-error: true
env:
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ execplan/
# Generated npm bundle output (local)
cli/npm/main/
.ace-tool/
# Desktop generated packaging output
**/release/
**/release-artifacts/
desktop/resources/hapi-cli/*/*
!desktop/resources/hapi-cli/*/.gitkeep
Loading
Loading