-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add auxiliary cache for CI; use more specific date for ZIP bundle
- Loading branch information
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build auxiliary cache with libraries and assets | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: nixbuild/nix-quick-install-action@v29 | ||
- name: Free disk space | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
# this might remove tools that are actually needed, | ||
# if set to "true" but frees about 6 GB | ||
tool-cache: true | ||
# To make the environment in the flake's devShell available to future steps: | ||
- uses: rrbutani/use-nix-shell-action@v1 | ||
with: | ||
devShell: .#default | ||
- name: Calculate cache hash based on nixpkgs' revision | ||
run: | | ||
NIXPKGS_REV=$(nix flake metadata . --json 2>/dev/null | jq --raw-output '.locks.nodes."nixpkgs".locked.rev') | ||
echo "NIXPKGS_REV=$NIXPKGS_REV" >> "$GITHUB_ENV" | ||
- name: Build assets | ||
run: | | ||
nix build --inputs-from . --verbose --show-trace --print-build-logs --print-out-paths .#assets.x86_64-linux.defaultAssetsPath | ||
- name: Build libraries for all platforms | ||
run: | | ||
nix build --inputs-from . --verbose --show-trace --print-build-logs --print-out-paths .#forPrebuild.x86_64-linux | ||
- name: Save Nix store | ||
uses: nix-community/cache-nix-action/[email protected] | ||
with: | ||
primary-key: build-aux-${{ runner.os }}-${{ env.NIXPKGS_REV }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,10 +30,16 @@ jobs: | |
run: | | ||
NIXPKGS_REV=$(nix flake metadata . --json 2>/dev/null | jq --raw-output '.locks.nodes."nixpkgs".locked.rev') | ||
echo "NIXPKGS_REV=$NIXPKGS_REV" >> "$GITHUB_ENV" | ||
- uses: nix-community/cache-nix-action/[email protected] | ||
- name: Restore toolchain cache | ||
uses: nix-community/cache-nix-action/[email protected] | ||
with: | ||
primary-key: build-fpc-${{ runner.os }}-${{ env.NIXPKGS_REV }} | ||
fail-on: primary-key.miss | ||
- name: Restore auxiliary cache | ||
uses: nix-community/cache-nix-action/[email protected] | ||
with: | ||
primary-key: build-aux-${{ runner.os }}-${{ env.NIXPKGS_REV }} | ||
fail-on: primary-key.miss | ||
- name: Update Doom2D related inputs and populate environment variables | ||
run: | | ||
bash ./game/bundle/scripts/mkEnv.bash | ||
|
@@ -50,6 +56,7 @@ jobs: | |
D2DF_LAST_COMMIT_DATE: ${{ env.D2DF_LAST_COMMIT_DATE }} | ||
RES_LAST_COMMIT_DATE: ${{ env.RES_LAST_COMMIT_DATE }} | ||
EDITOR_LAST_COMMIT_DATE: ${{ env.D2DF_LAST_COMMIT_DATE }} | ||
DISTRO_CONTENT_CREATION_DATE: ${{ env.DISTRO_CONTENT_CREATION_DATE }} | ||
run: | | ||
bash ./game/bundle/scripts/mkZip.bash | ||
- uses: actions/upload-artifact@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters