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
67 changes: 47 additions & 20 deletions .github/workflows/desktop-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ name: Desktop binaries
# Each job produces exactly the file GameAnalyticsExt.yy expects:
# macos-universal libGameAnalytics.dylib (x86_64 + arm64)
# linux-x64 libGameAnalytics.so
# windows-x64 GameAnalytics_x64.dll
# windows-x86 GameAnalytics.dll
# windows-x64 GameAnalytics.dll (64-bit)
#
# 32-bit Windows was dropped: it never built (the DLL's import library
# collided with the C++ SDK's GameAnalytics.lib, LNK1149) and GameMaker's
# Windows target is x64. The extension declares one Windows library, named
# GameAnalytics.dll, and this is it.
#
# Collect them with ./fetch_desktop_binaries.py, or by hand:
# gh run download <run-id> -n desktop-binaries -D sample/extensions/GameAnalyticsExt
Expand All @@ -18,12 +22,9 @@ on:
workflow_dispatch:
inputs:
sdk_ref:
description: "gameanalytics-sdk-cpp ref to build against"
required: true
# Pinned to the commit that builds the static library with -fPIC, which
# the Linux .so link needs. v5.4.1 predates it, so the tag will NOT
# work. Move this to a release tag once that change is merged.
default: "424a87d77c7d9cc9a686e0b2484f52005145e723"
description: "override the gameanalytics-sdk-cpp ref (default: dependencies.json)"
required: false
default: ""
pull_request:
paths:
- "sample/extensions/GameAnalyticsExt/DesktopSource/**"
Expand All @@ -34,12 +35,43 @@ on:
- "sample/extensions/GameAnalyticsExt/DesktopSource/**"
- ".github/workflows/desktop-binaries.yml"

env:
# Used when the workflow is triggered by push/PR, where inputs are unset.
DEFAULT_SDK_REF: "424a87d77c7d9cc9a686e0b2484f52005145e723"

jobs:
# The ref lives in dependencies.json so that CI, the local build and
# ./download_externals.py cannot disagree about which C++ SDK is being built.
# It is resolved once here rather than in each matrix job, so every
# library is guaranteed to come from the same source revision.
dependency:
name: resolve C++ SDK ref
runs-on: ubuntu-latest
outputs:
sdk_ref: ${{ steps.resolve.outputs.sdk_ref }}
steps:
- uses: actions/checkout@v4

- name: Read the pinned ref
id: resolve
shell: bash
run: |
OVERRIDE="${{ github.event.inputs.sdk_ref }}"
if [ -n "$OVERRIDE" ]; then
REF="$OVERRIDE"
ORIGIN="workflow_dispatch input"
else
# A 'ref' in dependencies.json wins over 'version': the tag
# v5.4.1 builds the static library without -fPIC and the Linux .so
# then fails to link, so the pin is currently a commit past it.
REF=$(python3 -c 'import json; d=json.load(open("dependencies.json")); c=next(x for x in d if x["name"]=="GA-SDK-CPP"); print(c.get("ref") or "v"+c["version"])')
ORIGIN="dependencies.json"
fi
if [ -z "$REF" ]; then
echo "::error::could not determine a GA-SDK-CPP ref"
exit 1
fi
echo "sdk_ref=$REF" >> "$GITHUB_OUTPUT"
echo "Building against gameanalytics-sdk-cpp $REF (from $ORIGIN)"

build:
needs: dependency
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -59,11 +91,6 @@ jobs:
os: windows-2022
cmake_arch: x64
vcpkg_triplet: x64-windows-static-md
artifact: GameAnalytics_x64.dll
- name: windows-x86
os: windows-2022
cmake_arch: Win32
vcpkg_triplet: x86-windows-static-md
artifact: GameAnalytics.dll

steps:
Expand All @@ -74,7 +101,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: GameAnalytics/gameanalytics-sdk-cpp
ref: ${{ github.event.inputs.sdk_ref || env.DEFAULT_SDK_REF }}
ref: ${{ needs.dependency.outputs.sdk_ref }}
path: sdk-cpp
submodules: recursive

Expand Down Expand Up @@ -181,8 +208,8 @@ jobs:
with:
path: staging

# One artifact holding all four libraries, laid out so it can be unzipped
# straight over sample/extensions/GameAnalyticsExt/.
# One artifact holding all three libraries, laid out so it can be
# unzipped straight over sample/extensions/GameAnalyticsExt/.
- name: Flatten
run: |
mkdir -p desktop-binaries
Expand Down
22 changes: 16 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@
google-services.json
GoogleService-Info.plist

# Internal release tooling and planning documents. The public SDK is built by
# the workflow in .github/workflows; the publishing script that pushes to the
# Marketplace and the sister repositories is not part of it.
# Internal release tooling and planning documents. The publishing script that
# pushed to the Marketplace and the sister repositories belonged to the
# development repo; ./publish_release.py replaces it here.
publish_gamemaker_release.py

# Unpublished write-ups. These now live in internal/docs/, which the rule below
# already covers — kept as explicit guards so a `docs/` directory reappearing
# at the root cannot pull them into the public tree.
docs/release-readiness.md
docs/superpowers/

# Working notes and agent context. `internal/` is scratch space that never
# ships; CLAUDE.md is the context file Claude Code loads on open. Both describe
# how this repo relates to the internal development repo, so neither belongs in
# a public tree.
# ships and holds the repo-wide Claude Code context, the binding checker, the
# unpublished write-ups and the release credentials. The bare CLAUDE.md entries
# stay so that a copy reappearing at the root is ignored too.
internal/
CLAUDE.md
CLAUDE.local.md
Expand Down Expand Up @@ -77,6 +81,12 @@ CMakeFiles/
# Windows/vcpkg
vcpkg_installed/

# Upstream SDK sources fetched by ./download_externals.py. A checkout of
# another repository, at the version dependencies.json pins — not ours to
# track. Scoped to this one directory rather than a pattern, so it cannot
# catch a shipped library.
/external/

# The extension's shipped native libraries are release artifacts and must always
# be tracked. Kept explicit so a future build-output rule cannot silently drop
# one — an extension missing a library still loads, and only fails when a game
Expand Down
20 changes: 15 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@
All notable changes to the GameAnalytics GameMaker SDK.

<!--(CHANGELOG_TOP)-->
**4.1.0**
**5.0.0**

Breaking:
* 32-bit Windows is no longer supported, and `GameAnalytics_x64.dll` is gone — the Windows library is `GameAnalytics.dll` and is 64-bit
* the SDK is three resources, not two: `obj_gameanalytics` ships alongside the extension and the scripts

Added:
* rewrote the GML wrapper as a single `GameAnalytics.gml` that dispatches per platform
* added `customFields` / `mergeFields` to every event function
* added remote config and A/B testing getters: `ga_is_remote_configs_ready`, `ga_get_remote_configs_content`, `ga_get_ab_testing_id`, `ga_get_ab_testing_variant_id`
* added `ga_get_user_id` and `ga_get_external_user_id`
* rebuilt the macOS native library from the current C++ SDK, fixing an out-of-bounds read in the `add*EventJson` entry points that could crash the game
* desktop uploads now go through GameMaker's own HTTP stack (`ga_http_pump` / `ga_http_handle_async` / `ga_http_abort`), removing the cURL and OpenSSL dependency
* added a runnable sample project covering every event type
* added CI that builds and export-checks all four desktop libraries
* added CI that builds and export-checks every desktop library
* added `dependencies.json`, recording the upstream SDK version behind each shipped artifact

Changed:
* rebuilt all three desktop libraries from the current C++ SDK, fixing an out-of-bounds read in the `add*EventJson` entry points that could crash the game — previously only macOS had been rebuilt
* desktop uploads go through GameMaker's own HTTP stack, removing the cURL and OpenSSL dependency
* `ga_initialize()` now starts the desktop HTTP bridge itself; `ga_http_pump`, `ga_http_handle_async` and `ga_http_abort` are no longer something you wire up, and remain public and safe to call

Releases before 4.1.0 were published from the previous repository and are not
Releases before 5.0.0 were published from the previous repository and are not
reproduced here.
Loading
Loading