2023-03-07 18:13:41 -07:00
|
|
|
name: Deploy to Steam
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
2023-06-08 14:35:29 -06:00
|
|
|
ref:
|
2023-05-21 11:34:17 -06:00
|
|
|
description: Branch or commit hash
|
2023-03-07 18:13:41 -07:00
|
|
|
type: string
|
|
|
|
required: true
|
2023-05-21 11:34:17 -06:00
|
|
|
default: develop
|
2023-03-07 18:13:41 -07:00
|
|
|
version:
|
2023-05-21 11:34:17 -06:00
|
|
|
description: Version or build description
|
2023-03-07 18:13:41 -07:00
|
|
|
type: string
|
|
|
|
required: true
|
|
|
|
release_channel:
|
|
|
|
description: Release channel
|
|
|
|
type: string
|
2023-04-29 23:30:42 -06:00
|
|
|
required: true
|
|
|
|
default: staging
|
2023-03-07 18:13:41 -07:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy-to-steam:
|
|
|
|
name: Deploy to Steam
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
2023-07-22 23:54:21 -06:00
|
|
|
- name: Set up Python 3
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: 3
|
2023-04-30 00:31:44 -06:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2023-07-22 23:54:21 -06:00
|
|
|
sudo apt-get install \
|
|
|
|
ccache \
|
|
|
|
libxml-libxslt-perl \
|
2023-07-23 02:46:33 -06:00
|
|
|
ninja-build
|
2023-07-22 23:54:21 -06:00
|
|
|
pip install 'sphinx<4.4.0'
|
2023-03-07 18:13:41 -07:00
|
|
|
- name: Clone DFHack
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
fetch-depth: 0
|
2023-06-08 14:35:29 -06:00
|
|
|
ref: ${{ github.event.inputs.ref }}
|
2023-05-18 15:06:00 -06:00
|
|
|
- name: Get 3rd party SDKs
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: DFHack/3rdparty
|
|
|
|
ref: main
|
2023-05-18 16:10:15 -06:00
|
|
|
ssh-key: ${{ secrets.DFHACK_3RDPARTY_TOKEN }}
|
2023-05-18 17:16:24 -06:00
|
|
|
path: depends/steam
|
2023-07-22 23:54:21 -06:00
|
|
|
- name: Fetch linux64 ccache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ~/.ccache
|
2023-07-23 02:46:33 -06:00
|
|
|
key: ccache-ubuntu-22.04-gcc-11-${{ github.sha }}
|
2023-07-22 23:54:21 -06:00
|
|
|
restore-keys: |
|
2023-07-23 02:46:33 -06:00
|
|
|
ccache-ubuntu-22.04-gcc-11
|
2023-07-22 23:54:21 -06:00
|
|
|
- name: Fetch win64 ccache
|
2023-03-07 18:13:41 -07:00
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: build/win64-cross/ccache
|
2023-06-08 14:35:29 -06:00
|
|
|
key: ccache-win64-cross-msvc-${{ github.sha }}
|
2023-03-07 18:13:41 -07:00
|
|
|
restore-keys: |
|
|
|
|
ccache-win64-cross-msvc
|
2023-07-22 23:54:21 -06:00
|
|
|
- name: Set up environment
|
|
|
|
id: env_setup
|
|
|
|
run: |
|
|
|
|
echo "CCACHE_DIR=${HOME}/.ccache" >> $GITHUB_ENV
|
|
|
|
- name: Configure DFHack
|
|
|
|
run: |
|
|
|
|
cmake \
|
|
|
|
-S . \
|
|
|
|
-B build \
|
|
|
|
-G Ninja \
|
|
|
|
-DDFHACK_BUILD_ARCH=64 \
|
2023-07-23 12:00:44 -06:00
|
|
|
-DBUILD_STONESENSE:BOOL=1 \
|
2023-07-22 23:54:21 -06:00
|
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
|
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
|
|
|
-DBUILD_DFLAUNCH:BOOL=1 \
|
|
|
|
-DBUILD_DOCS:BOOL=1 \
|
2023-07-23 02:46:33 -06:00
|
|
|
-DCMAKE_INSTALL_PREFIX=build/output
|
2023-07-22 23:54:21 -06:00
|
|
|
- name: Build DFHack
|
|
|
|
run: |
|
|
|
|
ninja -C build install
|
|
|
|
ccache --max-size 50M
|
|
|
|
ccache --cleanup
|
|
|
|
ccache --show-stats
|
2023-03-07 18:13:41 -07:00
|
|
|
- name: Cross-compile win64 artifacts
|
|
|
|
env:
|
2023-07-23 12:00:44 -06:00
|
|
|
CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1 -DBUILD_DFLAUNCH:BOOL=1'
|
2023-04-18 20:52:57 -06:00
|
|
|
steam_username: ${{ secrets.STEAM_SDK_USERNAME }}
|
|
|
|
steam_password: ${{ secrets.STEAM_SDK_PASSWORD }}
|
2023-03-07 18:13:41 -07:00
|
|
|
run: |
|
2023-06-08 14:35:29 -06:00
|
|
|
echo "ref: ${{ github.event.inputs.ref }}"
|
|
|
|
echo "sha: ${{ github.sha }}"
|
2023-04-26 14:36:40 -06:00
|
|
|
echo "version: ${{ github.event.inputs.version }}"
|
|
|
|
echo "release_channel: ${{ github.event.inputs.release_channel }}"
|
|
|
|
echo
|
2023-03-07 18:13:41 -07:00
|
|
|
cd build
|
|
|
|
bash -x build-win64-from-linux.sh
|
2023-04-30 00:46:06 -06:00
|
|
|
ccache -d win64-cross/ccache --max-size 200M
|
|
|
|
ccache -d win64-cross/ccache --cleanup
|
|
|
|
ccache -d win64-cross/ccache --show-stats
|
2023-03-07 18:13:41 -07:00
|
|
|
- name: Steam deploy
|
2023-07-17 14:46:54 -06:00
|
|
|
uses: game-ci/steam-deploy@v3
|
2023-03-07 18:13:41 -07:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.STEAM_USERNAME }}
|
|
|
|
configVdf: ${{ secrets.STEAM_CONFIG_VDF}}
|
|
|
|
appId: 2346660
|
|
|
|
buildDescription: ${{ github.event.inputs.version }}
|
2023-03-07 18:34:44 -07:00
|
|
|
rootPath: build
|
|
|
|
depot1Path: win64-cross/output
|
2023-07-23 02:46:33 -06:00
|
|
|
depot2Path: output
|
2023-03-07 18:13:41 -07:00
|
|
|
releaseBranch: ${{ github.event.inputs.release_channel }}
|