Skip to content
Merged
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
4 changes: 2 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ cd blitz-forge
./scripts/bootstrap_macos.sh # one-time: installs cmake/ninja/llvm and runtime deps via Homebrew
./compile.sh # builds bin/blitzcc, bin/runtime.dylib, bin/linker.dylib
./test.sh # runs tests/*.bb against -target macos-arm64
./publish.sh # produce a redistributable archive
./publish.sh # stage release/ and write release/blitzforge-macos-arm64.zip
```

Build artifacts land in [`bin/`](bin) and a redistributable archive in `release/`.
Build artifacts land in [`bin/`](bin), a staged [`release/`](release) directory, and a redistributable ZIP archive such as `release/blitzforge-macos-arm64.zip` or `release/blitzforge-windows-x64.zip`.

The compiler accepts an explicit `-target` flag (`host`, `windows-x86`, or `macos-arm64`). On macOS hosts, `host` and `macos-arm64` are equivalent; cross-compiling to a foreign target is rejected up-front rather than producing a broken artifact. Until a native macOS runtime is wired up, `./test.sh` validates the full compile/translate/assemble pipeline and explicitly **skips** the in-process execution smoke with a clear "alpha stub runtime" notice — so a stub runtime can never be silently mistaken for a working one.

Expand Down
16 changes: 16 additions & 0 deletions publish.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
setlocal

for %%I in ("%~dp0.") do set "ROOTDIR=%%~fI"
set "ARCHIVE_BASENAME=blitzforge-windows-x64"
set "ARCHIVE_PATH=%ROOTDIR%\release\%ARCHIVE_BASENAME%.zip"

call "%ROOTDIR%\compile.bat"

Expand Down Expand Up @@ -33,4 +35,18 @@ if exist "%ROOTDIR%\..\..\extras\vscode-blitz-forge" (
REM Create a README.txt file
echo "BlitzForge is a compiler for an enhanced version of the Blitz3D language. It is a fork of the Blitz3D compiler and adds support for the BlitzForge commands and syntax. You can develop with BlitzForge in Visual Studio Code by installing the .vsix extension. Press Ctrl+Shift+P and search for vsix to install the extension." > "%ROOTDIR%\release\README.txt"

set "PACKAGE_TMP=%TEMP%\blitzforge-package-%RANDOM%-%RANDOM%"
set "PACKAGE_ROOT=%PACKAGE_TMP%\%ARCHIVE_BASENAME%"
mkdir "%PACKAGE_ROOT%"
xcopy /E /Y /I "%ROOTDIR%\release\*" "%PACKAGE_ROOT%\" >nul
if exist "%ARCHIVE_PATH%" del /Q "%ARCHIVE_PATH%"
powershell -NoProfile -Command "Compress-Archive -Path '%PACKAGE_ROOT%' -DestinationPath '%ARCHIVE_PATH%' -CompressionLevel Optimal"
if errorlevel 1 (
rd /S /Q "%PACKAGE_TMP%"
endlocal
exit /b 1
)
rd /S /Q "%PACKAGE_TMP%"
echo Created release archive: "%ARCHIVE_PATH%"

endlocal
45 changes: 45 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,39 @@ set -euo pipefail
ROOTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
RELEASE_DIR="${ROOTDIR}/release"

host_archive_basename() {
case "$(uname -s)" in
Darwin) echo "blitzforge-macos-arm64" ;;
Linux) echo "blitzforge-linux-host" ;;
*) echo "blitzforge-unix-host" ;;
esac
}

create_zip_archive() {
local source_parent="$1"
local source_name="$2"
local archive_path="$3"

if command -v zip >/dev/null 2>&1; then
(
cd "${source_parent}"
zip -qr "${archive_path}" "${source_name}"
)
return
fi

if command -v python3 >/dev/null 2>&1; then
(
cd "${source_parent}"
python3 -m zipfile -c "${archive_path}" "${source_name}"
)
return
fi

echo "Unable to create release archive: install zip or python3." >&2
exit 1
}

"${ROOTDIR}/compile.sh"

rm -rf "${RELEASE_DIR}"
Expand All @@ -25,3 +58,15 @@ BlitzForge is a compiler for an enhanced version of the Blitz3D language.
It is a fork of the Blitz3D compiler and adds support for BlitzForge commands and syntax.
You can develop with BlitzForge in Visual Studio Code by installing the bundled .vsix extension.
EOF

ARCHIVE_BASENAME="$(host_archive_basename)"
ARCHIVE_PATH="${RELEASE_DIR}/${ARCHIVE_BASENAME}.zip"
PACKAGE_TMPDIR="$(mktemp -d "${TMPDIR:-/tmp}/blitzforge-package.XXXXXX")"
trap 'rm -rf "${PACKAGE_TMPDIR}"' EXIT
PACKAGE_ROOT="${PACKAGE_TMPDIR}/${ARCHIVE_BASENAME}"
mkdir -p "${PACKAGE_ROOT}"
rsync -a "${RELEASE_DIR}/" "${PACKAGE_ROOT}/"
rm -f "${ARCHIVE_PATH}"
create_zip_archive "${PACKAGE_TMPDIR}" "${ARCHIVE_BASENAME}" "${ARCHIVE_PATH}"

echo "Created release archive: ${ARCHIVE_PATH}"
Loading