adapt CI workflows to the monorepo layout

gamedir and gamedir-languages now live in this repository, so the build
no longer clones them separately or pins their commits in versions.env:
one commit SHA identifies everything. The compile job sparse-checks-out
the source only, and the assemble job the game data only, both with
blob:none so neither downloads the other half. Dist names drop the
G....L.... gamedir suffixes since GAME_VERSION now covers the data too.
This commit is contained in:
Marco Antonio J. Costa
2026-07-28 19:08:23 -03:00
parent 8366b00793
commit a1784fbaff
2 changed files with 21 additions and 71 deletions
+13 -52
View File
@@ -18,33 +18,13 @@ jobs:
filter: 'tree:0'
fetch-depth: 0
- name: Clone gamedir metadata
run: |
set -eux
GAMEDIR_REPOSITORY=1dot13/gamedir
GAMEDIR_LANGUAGES_REPOSITORY=1dot13/gamedir-languages
# filter tree is what makes this fast
git clone --config transfer.fsckobjects=false --no-checkout --filter=tree:0 \
https://github.com/$GAMEDIR_REPOSITORY \
gamedir
git clone --config transfer.fsckobjects=false --no-checkout --filter=tree:0 \
https://github.com/$GAMEDIR_LANGUAGES_REPOSITORY \
gamedir-languages
mkdir dist/
echo -n "
GAMEDIR_REPOSITORY=$GAMEDIR_REPOSITORY
GAMEDIR_LANGUAGES_REPOSITORY=$GAMEDIR_LANGUAGES_REPOSITORY
" > dist/versions.env
- name: Generate source version information
working-directory: source
run: |
set -eux
mkdir ../dist/
SOURCE_COMMIT_DATETIME=$(TZ=UTC0 git log -1 --date=iso-strict-local --format=%cd $GITHUB_SHA)
SOURCE_COMMIT_DATE=$(TZ=UTC0 git log -1 --date=short-local --format=%cd $GITHUB_SHA)
@@ -91,35 +71,7 @@ jobs:
GAME_VERSION=$GAME_VERSION
GAME_BUILD_INFORMATION=$GAME_BUILD_INFORMATION
GIT_SHA=$GIT_SHA
" >> ../dist/versions.env
# due to building everything in parallel, versions should be pinned at the start so everything builds based on the same versions
- name: Generate gamedir version information
working-directory: gamedir
run: |
set -eux
GAMEDIR_COMMIT_SHA=$(git rev-parse HEAD)
GAMEDIR_COMMIT_DATETIME=$(TZ=UTC0 git log -1 --date=iso-strict-local --format=%cd $GAMEDIR_COMMIT_SHA)
echo -n "
GAMEDIR_COMMIT_SHA=$GAMEDIR_COMMIT_SHA
GAMEDIR_COMMIT_DATETIME=$GAMEDIR_COMMIT_DATETIME
" >> ../dist/versions.env
# due to building everything in parallel, versions should be pinned at the start so everything builds based on the same versions
- name: Generate gamedir-languages version information
working-directory: gamedir-languages
run: |
set -eux
GAMEDIR_LANGUAGES_COMMIT_SHA=$(git rev-parse HEAD)
GAMEDIR_LANGUAGES_COMMIT_DATETIME=$(TZ=UTC0 git log -1 --date=iso-strict-local --format=%cd $GAMEDIR_LANGUAGES_COMMIT_SHA)
echo -n "
GAMEDIR_LANGUAGES_COMMIT_SHA=$GAMEDIR_LANGUAGES_COMMIT_SHA
GAMEDIR_LANGUAGES_COMMIT_DATETIME=$GAMEDIR_LANGUAGES_COMMIT_DATETIME
" >> ../dist/versions.env
" > ../dist/versions.env
- name: Show version information summary
run: |
@@ -145,8 +97,17 @@ jobs:
SCCACHE_GHA_ENABLED: 'true'
steps:
# the game data in gamedir/ and gamedir-languages/ is not needed to
# compile and would add gigabytes to the checkout
- name: Checkout source
uses: actions/checkout@v7
with:
filter: 'blob:none'
sparse-checkout: |
/*
!gamedir/
!gamedir-languages/
sparse-checkout-cone-mode: false
- name: Download versions.env
uses: actions/download-artifact@v8
+8 -19
View File
@@ -51,20 +51,15 @@ jobs:
shell: bash
run: cat artifacts/versions.env >> $GITHUB_ENV
- name: Checkout gamedir
# blob:none plus a sparse checkout fetches only the game data, not the
# engine source; both directories come from the same pinned commit
- name: Checkout gamedir and gamedir-languages
uses: actions/checkout@v7
with:
repository: ${{ env.GAMEDIR_REPOSITORY }}
ref: ${{ env.GAMEDIR_COMMIT_SHA }}
path: gamedir
- name: Checkout gamedir-languages
if: matrix.language != 'English'
uses: actions/checkout@v7
with:
repository: ${{ env.GAMEDIR_LANGUAGES_REPOSITORY }}
ref: ${{ env.GAMEDIR_LANGUAGES_COMMIT_SHA }}
path: gamedir-languages
filter: 'blob:none'
sparse-checkout: |
gamedir
gamedir-languages
- name: Copy gamedir-languages files to gamedir
if: matrix.language != 'English'
@@ -95,7 +90,7 @@ jobs:
# "-" separates words, "_" combines words, see double-click behavior
DIST_PREFIX='JA2_113'
DIST_NAME="${DIST_PREFIX}-${GAME_VERSION}-G${GAMEDIR_COMMIT_SHA:0:4}L${GAMEDIR_LANGUAGES_COMMIT_SHA:0:4}-${{ matrix.language }}"
DIST_NAME="${DIST_PREFIX}-${GAME_VERSION}-${{ matrix.language }}"
echo "DIST_NAME=$DIST_NAME" >> $GITHUB_ENV
echo "If you encounter problems during gameplay, please provide the following version information:
@@ -106,12 +101,6 @@ jobs:
Source Repository: $GITHUB_REPOSITORY
Source Commit SHA: $GITHUB_SHA
Source Commit Date: $SOURCE_COMMIT_DATETIME
Gamedir Repository: $GAMEDIR_REPOSITORY
Gamedir Commit SHA: $GAMEDIR_COMMIT_SHA
Gamedir Commit Date: $GAMEDIR_COMMIT_DATETIME
Gamedir Languages Repository: $GAMEDIR_LANGUAGES_REPOSITORY
Gamedir Languages Commit SHA: $GAMEDIR_LANGUAGES_COMMIT_SHA
Gamedir Languages Commit Date: $GAMEDIR_LANGUAGES_COMMIT_DATETIME
" > "gamedir/${DIST_PREFIX}-Version.txt"
cat "gamedir/${DIST_PREFIX}-Version.txt"