Merge pull request #3607 from myk002/myk_runners

reusable and native build action runners
develop
Myk 2023-07-31 05:08:35 -07:00 committed by GitHub
commit 656683e001
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 540 additions and 375 deletions

@ -0,0 +1,65 @@
#### Q: How do I download DFHack?
**A:** Either add to your Steam library from our [Steam page](https://store.steampowered.com/app/2346660/DFHack) or scroll to the latest release on our [GitHub releases page](https://github.com/DFHack/dfhack/releases), expand the "Assets" list, and download the file for your platform (e.g. `dfhack-XX.XX-rX-Windows-64bit.zip`.
-------------
This release is compatible with all distributions of Dwarf Fortress: [Steam](https://store.steampowered.com/app/975370/Dwarf_Fortress/), [Itch](https://kitfoxgames.itch.io/dwarf-fortress), and [Classic](https://www.bay12games.com/dwarves/).
- [Install DFHack from Steam](https://store.steampowered.com/app/2346660/DFHack)
- [Manual install](https://docs.dfhack.org/en/stable/docs/Installing.html#installing)
- [Quickstart guide (for players)](https://docs.dfhack.org/en/stable/docs/Quickstart.html#quickstart)
- [Modding guide (for modders)](https://docs.dfhack.org/en/stable/docs/guides/modding-guide.html)
Please report any issues (or feature requests) on the DFHack [GitHub issue tracker](https://github.com/DFHack/dfhack/issues). When reporting issues, please upload a zip file of your savegame and a zip file of your `mods` directory to the cloud and add links to the GitHub issue. Make sure your files are downloadable by "everyone with the link". We need your savegame to reproduce the problem and test the fix, and we need your active mods so we can load your savegame. Issues with savegames and mods attached get fixed first!
Announcements
----------------------------------
<details>
<summary>Annc 1, PSAs</summary>
### Annc 1
Text
### PSAs
As always, remember that, just like the vanilla DF game, DFHack tools can also have bugs. It is a good idea to **save often and keep backups** of the forts that you care about.
Many DFHack tools that worked in previous (pre-Steam) versions of DF have not been updated yet and are marked with the "unavailable" tag in their docs. If you try to run them, they will show a warning and exit immediately. You can run the command again to override the warning (though of course the tools may not work). We make no guarantees of reliability for the tools that are marked as "unavailable".
The in-game interface for running DFHack commands (`gui/launcher`) will not show "unavailable" tools by default. You can still run them if you know their names, or you can turn on dev mode by hitting Ctrl-D while in `gui/launcher` and they will be added to the autocomplete list. Some tools do not compile yet and are not available at all, even when in dev mode.
If you see a tool complaining about the lack of a cursor, know that it's referring to the **keyboard** cursor (which used to be the only real option in Dwarf Fortress). You can enable the keyboard cursor by entering mining mode or selecting the dump/forbid tool and hitting Alt-K (the DFHack keybinding for `toggle-kbd-cursor`. We're working on making DFHack tools more mouse-aware and accessible so this step isn't necessary in the future.
</details>
Highlights
----------------------------------
<details>
<summary>Highlight 1, Highlight 2</summary>
### Highlight 1
Demo screenshot/vidcap
Text
### Highlight 2
Demo screenshot/vidcap
Text
</details>
Generated release notes
====================
<details>
<summary>New tools, fixes, and improvements</summary>
%RELEASE_NOTES%
</details>

@ -0,0 +1,126 @@
name: build-linux
on:
workflow_call:
inputs:
ref:
type: string
default: ''
artifact-name:
type: string
append-date-and-hash:
type: boolean
default: false
cache-id:
type: string
default: ''
cache-readonly:
type: boolean
default: false
platform-files:
type: boolean
default: true
common-files:
type: boolean
default: true
docs:
type: boolean
default: false
stonesense:
type: boolean
default: false
extras:
type: boolean
default: false
gcc-ver:
type: string
default: "10"
jobs:
build-linux64:
name: Build linux64
runs-on: ubuntu-22.04
steps:
- name: Install basic build dependencies
run: |
sudo apt-get update
sudo apt-get install ninja-build
- name: Install binary build dependencies
if: inputs.platform-files
run: |
sudo apt-get install \
ccache \
gcc-${{ inputs.gcc-ver }} \
g++-${{ inputs.gcc-ver }} \
libxml-libxslt-perl
- name: Install stonesense dependencies
if: inputs.stonesense
run: sudo apt-get install libgl-dev
- name: Install doc dependencies
if: inputs.docs
run: pip install 'sphinx<4.4.0'
- name: Clone DFHack
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
submodules: true
fetch-depth: ${{ !inputs.platform-files && 1 || 0 }}
- name: Fetch ccache
if: inputs.platform-files
uses: actions/cache/restore@v3
with:
path: ~/.cache/ccache
key: linux-gcc-${{ inputs.gcc-ver }}-${{ inputs.cache-id }}-${{ github.sha }}
restore-keys: |
linux-gcc-${{ inputs.gcc-ver }}-${{ inputs.cache-id }}
linux-gcc-${{ inputs.gcc-ver }}
- name: Configure DFHack
env:
CC: gcc-${{ inputs.gcc-ver }}
CXX: g++-${{ inputs.gcc-ver }}
run: |
cmake \
-S . \
-B build \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=build/image \
-DCMAKE_BUILD_TYPE=Release \
${{ inputs.platform-files && '-DCMAKE_C_COMPILER_LAUNCHER=ccache' || '' }} \
${{ inputs.platform-files && '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache' || '' }} \
-DBUILD_LIBRARY:BOOL=${{ inputs.platform-files }} \
-DBUILD_PLUGINS:BOOL=${{ inputs.platform-files }} \
-DBUILD_STONESENSE:BOOL=${{ inputs.stonesense }} \
-DBUILD_DEV_PLUGINS:BOOL=${{ inputs.extras }} \
-DBUILD_SIZECHECK:BOOL=${{ inputs.extras }} \
-DBUILD_SKELETON:BOOL=${{ inputs.extras }} \
-DBUILD_DOCS:BOOL=${{ inputs.docs }} \
-DINSTALL_DATA_FILES:BOOL=${{ inputs.common-files }} \
-DINSTALL_SCRIPTS:BOOL=${{ inputs.common-files }}
- name: Build DFHack
run: ninja -C build install
- name: Run cpp tests
if: inputs.platform-files
run: ninja -C build test
- name: Trim cache
if: inputs.platform-files
run: |
ccache --max-size 40M
ccache --cleanup
ccache --show-stats --verbose
- name: Save ccache
if: inputs.platform-files && !inputs.cache-readonly
uses: actions/cache/save@v3
with:
path: ~/.cache/ccache
key: linux-gcc-${{ inputs.gcc-ver }}-${{ inputs.cache-id }}-${{ github.sha }}
- name: Format artifact name
if: inputs.append-date-and-hash
id: artifactname
run: |
echo name=${{ inputs.artifact-name }}-$(date +%Y%m%d)-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
- name: Upload artifact
if: inputs.artifact-name
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.append-date-and-hash && steps.artifactname.outputs.name || inputs.artifact-name }}
path: build/image/*

@ -0,0 +1,84 @@
name: build-windows
on:
workflow_call:
inputs:
ref:
type: string
default: ''
artifact-name:
type: string
append-date-and-hash:
type: boolean
default: false
cache-id:
type: string
default: ''
cache-readonly:
type: boolean
default: false
common-files:
type: boolean
default: true
launchdf:
type: boolean
default: false
jobs:
build-win64:
name: Build win64
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install ccache
- name: Clone DFHack
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
submodules: true
fetch-depth: 0
- name: Get 3rd party SDKs
if: inputs.launchdf
uses: actions/checkout@v3
with:
repository: DFHack/3rdparty
ref: main
ssh-key: ${{ secrets.DFHACK_3RDPARTY_TOKEN }}
path: depends/steam
- name: Fetch ccache
uses: actions/cache/restore@v3
with:
path: build/win64-cross/ccache
key: win-msvc-${{ inputs.cache-id }}-${{ github.sha }}
restore-keys: |
win-msvc-${{ inputs.cache-id }}
win-msvc
- name: Cross-compile
env:
CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1 -DBUILD_DOCS:BOOL=${{ inputs.common-files }} -DINSTALL_DATA_FILES:BOOL=${{ inputs.common-files }} -DINSTALL_SCRIPTS:BOOL=${{ inputs.common-files }} -DBUILD_DFLAUNCH:BOOL=${{ inputs.launchdf }}'
run: |
cd build
bash -x build-win64-from-linux.sh
- name: Trim cache
run: |
cd build
ccache -d win64-cross/ccache --max-size 200M
ccache -d win64-cross/ccache --cleanup
ccache -d win64-cross/ccache --show-stats --verbose
- name: Save ccache
uses: actions/cache/save@v3
with:
path: build/win64-cross/ccache
key: win-msvc-${{ inputs.cache-id }}-${{ github.sha }}
- name: Format artifact name
if: inputs.append-date-and-hash
id: artifactname
run: echo "name=${{ inputs.artifact-name }}-$(date +%Y%m%d)-$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Upload artifact
if: inputs.artifact-name
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.append-date-and-hash && steps.artifactname.outputs.name || inputs.artifact-name }}
path: build/win64-cross/output/*

@ -3,98 +3,50 @@ name: Build
on: [push, pull_request]
jobs:
build-test:
runs-on: ${{ matrix.os }}
build-linux:
name: Linux gcc-${{ matrix.gcc }}
uses: ./.github/workflows/build-linux.yml
with:
artifact-name: test-gcc-${{ matrix.gcc }}
cache-id: test
stonesense: ${{ matrix.plugins == 'all' }}
extras: ${{ matrix.plugins == 'all' }}
gcc-ver: ${{ matrix.gcc }}
secrets: inherit
strategy:
fail-fast: false
matrix:
include:
- gcc: 10
plugins: "default"
- gcc: 12
plugins: "all"
test-linux:
name: Test (Linux, GCC ${{ matrix.gcc }}, ${{ matrix.plugins }} plugins)
needs: build-linux
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
gcc:
- 10
plugins:
- default
include:
- os: ubuntu-22.04
gcc: 12
plugins: all
- gcc: 10
plugins: "default"
- gcc: 12
plugins: "all"
steps:
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: 3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install \
ccache \
libgl-dev \
libxml-libxslt-perl \
ninja-build
pip install 'sphinx<4.4.0'
- name: Install GCC
run: |
sudo apt-get install gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
- name: Clone DFHack
uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
with:
submodules: true
fetch-depth: 0
- name: Set up environment
id: env_setup
run: |
DF_VERSION="$(sh ci/get-df-version.sh)"
echo "df_version=${DF_VERSION}" >> $GITHUB_OUTPUT
echo "DF_VERSION=${DF_VERSION}" >> $GITHUB_ENV
echo "DF_FOLDER=${HOME}/DF/${DF_VERSION}/df_linux" >> $GITHUB_ENV
echo "CCACHE_DIR=${HOME}/.ccache" >> $GITHUB_ENV
- name: Fetch ccache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ccache-${{ matrix.os }}-gcc-${{ matrix.gcc }}-test-${{ github.sha }}
restore-keys: |
ccache-${{ matrix.os }}-gcc-${{ matrix.gcc }}-test
ccache-${{ matrix.os }}-gcc-${{ matrix.gcc }}
name: test-gcc-${{ matrix.gcc }}
# - name: Fetch DF cache
# uses: actions/cache@v3
# with:
# path: ~/DF
# key: df-${{ steps.env_setup.outputs.df_version }}-${{ hashFiles('ci/download-df.sh') }}
# key: df-${{ hashFiles('ci/download-df.sh') }}
# - name: Download DF
# run: |
# sh ci/download-df.sh
- name: Configure DFHack
env:
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
run: |
cmake \
-S . \
-B build-ci \
-G Ninja \
-DCMAKE_INSTALL_PREFIX="$DF_FOLDER" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DDFHACK_BUILD_ARCH=64 \
-DBUILD_DEV_PLUGINS:BOOL=${{ matrix.plugins == 'all' }} \
-DBUILD_SIZECHECK:BOOL=${{ matrix.plugins == 'all' }} \
-DBUILD_SKELETON:BOOL=${{ matrix.plugins == 'all' }} \
-DBUILD_STONESENSE:BOOL=${{ matrix.plugins == 'all' }} \
-DBUILD_TESTS:BOOL=ON
- name: Build DFHack
run: |
ninja -C build-ci install
ccache --max-size 50M
ccache --cleanup
ccache --show-stats
- name: Run cpp unit tests
id: run_tests_cpp
run: |
ninja -C build-ci test
exit $?
# - name: Run lua tests
# id: run_tests_lua
# run: |
@ -119,137 +71,37 @@ jobs:
# run: |
# rm -rf "$DF_FOLDER"
build-linux64:
package-linux:
name: Linux package
runs-on: ubuntu-22.04
steps:
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: 3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install \
ccache \
gcc-10 \
g++-10 \
libgl-dev \
libxml-libxslt-perl \
ninja-build
pip install 'sphinx<4.4.0'
- name: Clone DFHack
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Fetch ccache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ccache-ubuntu-22.04-gcc-10-${{ github.sha }}
restore-keys: |
ccache-ubuntu-22.04-gcc-10
- name: Set up environment
id: env_setup
run: |
echo "CCACHE_DIR=${HOME}/.ccache" >> $GITHUB_ENV
- name: Configure DFHack
env:
CC: gcc-10
CXX: g++-10
run: |
cmake \
-S . \
-B build \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=build/output \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DDFHACK_BUILD_ARCH=64 \
-DBUILD_DOCS:BOOL=1 \
-DBUILD_STONESENSE:BOOL=1
- name: Build DFHack
run: |
ninja -C build install
ccache --max-size 50M
ccache --cleanup
ccache --show-stats
- name: Format artifact name
id: artifactname
run: |
echo name=$(date +%Y%m%d)-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: dfhack-linux64-build-${{ steps.artifactname.outputs.name }}
path: build/output/*
uses: ./.github/workflows/build-linux.yml
with:
artifact-name: dfhack-linux64-build
append-date-and-hash: true
cache-id: release
stonesense: true
docs: true
secrets: inherit
build-cross-win64:
package-win64:
name: Win64 package
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install ccache
- name: Clone DFHack
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Fetch ccache
uses: actions/cache@v3
with:
path: build/win64-cross/ccache
key: ccache-win64-cross-msvc-${{ github.sha }}
restore-keys: |
ccache-win64-cross-msvc
- name: Cross-compile win64
env:
CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1'
run: |
cd build
bash -x build-win64-from-linux.sh
ccache -d win64-cross/ccache --max-size 200M
ccache -d win64-cross/ccache --cleanup
ccache -d win64-cross/ccache --show-stats
- name: Format artifact name
id: artifactname
run: |
echo name=$(date +%Y%m%d)-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: dfhack-win64-build-${{ steps.artifactname.outputs.name }}
path: build/win64-cross/output/*
uses: ./.github/workflows/build-windows.yml
with:
artifact-name: dfhack-win64-build
append-date-and-hash: true
cache-id: release
secrets: inherit
docs:
runs-on: ubuntu-22.04
steps:
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: 3
- name: Install dependencies
run: |
pip install 'sphinx'
- name: Clone DFHack
uses: actions/checkout@v3
with:
submodules: true
- name: Build docs
run: |
sphinx-build -W --keep-going -j auto --color . docs/html
uses: ./.github/workflows/build-linux.yml
with:
platform-files: false
common-files: false
docs: true
secrets: inherit
lint:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: 3
- name: Install Lua
run: |
sudo apt-get update
@ -258,22 +110,17 @@ jobs:
uses: actions/checkout@v3
with:
submodules: true
# don't need tags here
- name: Check whitespace
run: |
python ci/lint.py --git-only --github-actions
run: python ci/lint.py --git-only --github-actions
- name: Check Authors.rst
if: success() || failure()
run: |
python ci/authors-rst.py
if: always()
run: python ci/authors-rst.py
- name: Check for missing documentation
if: success() || failure()
run: |
python ci/script-docs.py
if: always()
run: python ci/script-docs.py
- name: Check Lua syntax
if: success() || failure()
run: |
python ci/script-syntax.py --ext=lua --cmd="luac5.3 -p" --github-actions
if: always()
run: python ci/script-syntax.py --ext=lua --cmd="luac5.3 -p" --github-actions
check-pr:
runs-on: ubuntu-latest

@ -1,4 +1,5 @@
name: Clean up PR caches
on:
pull_request_target:
types:

@ -0,0 +1,97 @@
name: Releases
on:
push:
tags:
- '*-r[0-9]+'
workflow_dispatch:
inputs:
tag:
description: tag
required: true
jobs:
package-win64:
name: Windows release
uses: ./.github/workflows/build-windows.yml
with:
artifact-name: win64-release
ref: ${{ github.event.inputs.tag }}
cache-id: release
cache-readonly: true
stonesense: true
docs: true
launchdf: true
secrets: inherit
package-linux64:
name: Linux release
uses: ./.github/workflows/build-linux.yml
with:
artifact-name: linux64-release
ref: ${{ github.event.inputs.tag }}
cache-id: release
cache-readonly: true
stonesense: true
docs: true
secrets: inherit
create-update-release:
name: GitHub release
needs:
- package-win64
- package-linux64
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Clone DFHack
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}
submodules: true
- name: Get tag
id: gettag
run: echo name=$(git describe --tags --abbrev=0 --exact-match) >> $GITHUB_OUTPUT
- name: Generate release text
run: |
python docs/gen_changelog.py -a
TOKEN_LINE=$(grep -Fhne '%RELEASE_NOTES%' .github/release_template.md | sed 's/:.*//')
head -n $((TOKEN_LINE - 1)) .github/release_template.md > release_body.md
CHANGELOG_LINES=$(wc -l <docs/changelogs/${{ steps.gettag.outputs.name }}-github.txt)
tail -n $((CHANGELOG_LINES - 3)) docs/changelogs/${{ steps.gettag.outputs.name }}-github.txt >> release_body.md
tail -n 2 .github/release_template.md >> release_body.md
cat release_body.md
- name: Stage win64 release
uses: actions/download-artifact@v3
with:
name: win64-release
path: win64
- name: Create win64 release archive
run: |
cd win64
zip -r ../dfhack-${{ steps.gettag.outputs.name }}-Windows-64bit.zip .
- name: Stage linux64 release
uses: actions/download-artifact@v3
with:
name: linux64-release
path: linux64
- name: Create linux64 release archive
run: |
cd linux64
tar cjf ../dfhack-${{ steps.gettag.outputs.name }}-Linux-64bit.tar.bz2 .
- name: Create or update GitHub release
uses: ncipollo/release-action@v1
with:
artifacts: "dfhack-*"
bodyFile: "release_body.md"
allowUpdates: true
artifactErrorsFailBuild: true
draft: true
name: "DFHack ${{ steps.gettag.outputs.name }}"
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
replacesArtifacts: true
tag: ${{ steps.gettag.outputs.name }}

@ -0,0 +1,91 @@
name: Deploy to Steam
on:
workflow_dispatch:
inputs:
ref:
description: Branch or commit hash
type: string
required: true
default: develop
version:
description: Version or build description
type: string
required: true
release_channel:
description: Steam release channel
type: string
required: true
default: staging
jobs:
depot-common:
name: Common depot files
uses: ./.github/workflows/build-linux.yml
with:
artifact-name: common-depot
ref: ${{ github.event.inputs.ref }}
platform-files: false
docs: true
stonesense: true
secrets: inherit
depot-win64:
name: Windows depot files
uses: ./.github/workflows/build-windows.yml
with:
artifact-name: win64-depot
ref: ${{ github.event.inputs.ref }}
cache-id: release
cache-readonly: true
common-files: false
launchdf: true
secrets: inherit
depot-linux64:
name: Linux depot files
uses: ./.github/workflows/build-linux.yml
with:
artifact-name: linux64-depot
ref: ${{ github.event.inputs.ref }}
cache-id: release
cache-readonly: true
common-files: false
stonesense: true
secrets: inherit
deploy-to-steam:
name: Deploy to Steam
needs:
- depot-common
- depot-win64
- depot-linux64
runs-on: ubuntu-latest
steps:
- name: Stage common depot files
uses: actions/download-artifact@v3
with:
name: common-depot
path: common
- name: Stage win64 depot files
uses: actions/download-artifact@v3
with:
name: win64-depot
path: win64
- name: Stage linux64 depot files
uses: actions/download-artifact@v3
with:
name: linux64-depot
path: linux64
- name: Steam deploy
uses: game-ci/steam-deploy@v3
with:
username: ${{ secrets.STEAM_USERNAME }}
configVdf: ${{ secrets.STEAM_CONFIG_VDF}}
appId: 2346660
buildDescription: ${{ github.event.inputs.version }}
rootPath: build
depot1Path: common
depot2Path: win64
depot3Path: linux64
releaseBranch: ${{ github.event.inputs.release_channel }}

@ -1,148 +0,0 @@
name: Deploy to Steam
on:
workflow_dispatch:
inputs:
ref:
description: Branch or commit hash
type: string
required: true
default: develop
version:
description: Version or build description
type: string
required: true
release_channel:
description: Release channel
type: string
required: true
default: staging
jobs:
deploy-to-steam:
name: Deploy to Steam
runs-on: ubuntu-22.04
steps:
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: 3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install \
ccache \
gcc-10 \
g++-10 \
libgl-dev \
libxml-libxslt-perl \
ninja-build
pip install 'sphinx<4.4.0'
- name: Clone DFHack
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
ref: ${{ github.event.inputs.ref }}
- name: Get 3rd party SDKs
uses: actions/checkout@v3
with:
repository: DFHack/3rdparty
ref: main
ssh-key: ${{ secrets.DFHACK_3RDPARTY_TOKEN }}
path: depends/steam
- name: Fetch linux64 ccache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ccache-ubuntu-22.04-gcc-10-${{ github.sha }}
restore-keys: |
ccache-ubuntu-22.04-gcc-10
- name: Fetch win64 ccache
uses: actions/cache@v3
with:
path: build/win64-cross/ccache
key: ccache-win64-cross-msvc-${{ github.sha }}
restore-keys: |
ccache-win64-cross-msvc
- name: Set up environment
id: env_setup
run: |
echo "CCACHE_DIR=${HOME}/.ccache" >> $GITHUB_ENV
- name: Configure DFHack (common files)
env:
CC: gcc-10
CXX: g++-10
run: |
cmake \
-S . \
-B build \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=build/common-output \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DDFHACK_BUILD_ARCH=64 \
-DBUILD_DOCS:BOOL=1 \
-DBUILD_LIBRARY:BOOL=0 \
-DBUILD_PLUGINS:BOOL=0 \
-DBUILD_STONESENSE:BOOL=1 \
-DINSTALL_DATA_FILES:BOOL=1 \
-DINSTALL_SCRIPTS:BOOL=1
- name: Build DFHack (common files)
run: |
ninja -C build install
- name: Configure DFHack (linux build)
env:
CC: gcc-10
CXX: g++-10
run: |
cmake \
-S . \
-B build \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=build/linux-output \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DDFHACK_BUILD_ARCH=64 \
-DBUILD_DOCS:BOOL=0 \
-DBUILD_LIBRARY:BOOL=1 \
-DBUILD_PLUGINS:BOOL=1 \
-DBUILD_STONESENSE:BOOL=1 \
-DINSTALL_DATA_FILES:BOOL=0 \
-DINSTALL_SCRIPTS:BOOL=0
- name: Build DFHack (linux build)
run: |
ninja -C build install
ccache --max-size 50M
ccache --cleanup
ccache --show-stats
- name: Cross-compile win64 artifacts
env:
CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1 -DBUILD_DFLAUNCH:BOOL=1 -DBUILD_DOCS:BOOL=0 -DINSTALL_DATA_FILES:BOOL=0 -DINSTALL_SCRIPTS:BOOL=0'
steam_username: ${{ secrets.STEAM_SDK_USERNAME }}
steam_password: ${{ secrets.STEAM_SDK_PASSWORD }}
run: |
echo "ref: ${{ github.event.inputs.ref }}"
echo "sha: ${{ github.sha }}"
echo "version: ${{ github.event.inputs.version }}"
echo "release_channel: ${{ github.event.inputs.release_channel }}"
echo
cd build
bash -x build-win64-from-linux.sh
ccache -d win64-cross/ccache --max-size 200M
ccache -d win64-cross/ccache --cleanup
ccache -d win64-cross/ccache --show-stats
- name: Steam deploy
uses: game-ci/steam-deploy@v3
with:
username: ${{ secrets.STEAM_USERNAME }}
configVdf: ${{ secrets.STEAM_CONFIG_VDF}}
appId: 2346660
buildDescription: ${{ github.event.inputs.version }}
rootPath: build
depot1Path: common-output
depot2Path: win64-cross/output
depot3Path: linux-output
releaseBranch: ${{ github.event.inputs.release_channel }}

@ -289,20 +289,22 @@ endif()
find_package(ZLIB REQUIRED)
include_directories(${ZLIB_INCLUDE_DIRS})
# Download SDL release and extract into depends in the build dir
# all we need are the header files (including generated headers), so the same release package
# will work for all platforms
# (the above statement is untested for OSX)
set(SDL_VERSION 2.26.2)
set(SDL_ZIP_MD5 574daf26d48de753d0b1e19823c9d8bb)
set(SDL_ZIP_FILE SDL2-devel-${SDL_VERSION}-VC.zip)
set(SDL_ZIP_PATH ${dfhack_SOURCE_DIR}/depends/SDL2/)
download_file("https://github.com/libsdl-org/SDL/releases/download/release-${SDL_VERSION}/${SDL_ZIP_FILE}"
${SDL_ZIP_PATH}${SDL_ZIP_FILE}
${SDL_ZIP_MD5})
file(ARCHIVE_EXTRACT INPUT ${SDL_ZIP_PATH}${SDL_ZIP_FILE}
DESTINATION ${SDL_ZIP_PATH})
include_directories(${SDL_ZIP_PATH}/SDL2-${SDL_VERSION}/include)
if(BUILD_LIBRARY)
# Download SDL release and extract into depends in the build dir
# all we need are the header files (including generated headers), so the same release package
# will work for all platforms
# (the above statement is untested for OSX)
set(SDL_VERSION 2.26.2)
set(SDL_ZIP_MD5 574daf26d48de753d0b1e19823c9d8bb)
set(SDL_ZIP_FILE SDL2-devel-${SDL_VERSION}-VC.zip)
set(SDL_ZIP_PATH ${dfhack_SOURCE_DIR}/depends/SDL2/)
download_file("https://github.com/libsdl-org/SDL/releases/download/release-${SDL_VERSION}/${SDL_ZIP_FILE}"
${SDL_ZIP_PATH}${SDL_ZIP_FILE}
${SDL_ZIP_MD5})
file(ARCHIVE_EXTRACT INPUT ${SDL_ZIP_PATH}${SDL_ZIP_FILE}
DESTINATION ${SDL_ZIP_PATH})
include_directories(${SDL_ZIP_PATH}/SDL2-${SDL_VERSION}/include)
endif()
if(APPLE)
# libstdc++ (GCC 4.8.5 for OS X 10.6)