Skip to content

Commit

Permalink
Merge branch 'develop' into adv-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Nov 30, 2024
2 parents b9f06d1 + dde6c44 commit 8116ed6
Show file tree
Hide file tree
Showing 11 changed files with 132 additions and 27 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ on:
platform-files:
type: boolean
default: true
plugins:
type: boolean
default: true
common-files:
type: boolean
default: true
Expand Down Expand Up @@ -104,7 +107,7 @@ jobs:
win-msvc
- name: Cross-compile
env:
CMAKE_EXTRA_ARGS: -DBUILD_LIBRARY=${{ inputs.platform-files }} -DBUILD_STONESENSE:BOOL=${{ inputs.stonesense }} -DBUILD_DOCS:BOOL=${{ inputs.docs }} -DBUILD_DOCS_NO_HTML:BOOL=${{ !inputs.html }} -DINSTALL_DATA_FILES:BOOL=${{ inputs.common-files }} -DINSTALL_SCRIPTS:BOOL=${{ inputs.common-files }} -DBUILD_DFLAUNCH:BOOL=${{ inputs.launchdf }} -DBUILD_TESTS:BOOL=${{ inputs.tests }} -DBUILD_XMLDUMP:BOOL=${{ inputs.xml-dump-type-sizes }} ${{ inputs.xml-dump-type-sizes && '-DINSTALL_XMLDUMP:BOOL=1' || '' }}
CMAKE_EXTRA_ARGS: -DBUILD_LIBRARY=${{ inputs.platform-files }} -DBUILD_PLUGINS:BOOL=${{ inputs.platform-files && inputs.plugins }} -DBUILD_STONESENSE:BOOL=${{ inputs.stonesense }} -DBUILD_DOCS:BOOL=${{ inputs.docs }} -DBUILD_DOCS_NO_HTML:BOOL=${{ !inputs.html }} -DINSTALL_DATA_FILES:BOOL=${{ inputs.common-files }} -DINSTALL_SCRIPTS:BOOL=${{ inputs.common-files }} -DBUILD_DFLAUNCH:BOOL=${{ inputs.launchdf }} -DBUILD_TESTS:BOOL=${{ inputs.tests }} -DBUILD_XMLDUMP:BOOL=${{ inputs.xml-dump-type-sizes }} ${{ inputs.xml-dump-type-sizes && '-DINSTALL_XMLDUMP:BOOL=1' || '' }}
run: |
cd build
bash -x build-win64-from-linux.sh
Expand Down
119 changes: 108 additions & 11 deletions .github/workflows/generate-symbols.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
required: true
default: master
version:
description: DF version
description: DF version (can be "auto" if channel is steam)
required: true
platform:
description: Target OS platform
Expand Down Expand Up @@ -44,7 +44,7 @@ on:
type: string

jobs:
package:
package-linux:
uses: ./.github/workflows/build-linux.yml
if: inputs.platform == 'all' || inputs.platform == 'linux'
with:
Expand All @@ -57,12 +57,25 @@ jobs:
plugins: false
secrets: inherit

package-win64:
uses: ./.github/workflows/build-windows.yml
if: (inputs.platform == 'all' || inputs.platform == 'windows') && inputs.version == 'auto'
with:
dfhack_ref: ${{ github.ref }}
structures_ref: ${{ inputs.structures_ref }}
artifact-name: dfhack-symbols-windows64-build
append-date-and-hash: false
cache-id: release
cache-readonly: true
plugins: false
secrets: inherit

generate-linux:
name: Generate linux64 symbols
runs-on: ubuntu-latest
if: inputs.platform == 'all' || inputs.platform == 'linux'
needs:
- package
- package-linux
steps:
- name: Install dependencies
run: |
Expand Down Expand Up @@ -119,11 +132,21 @@ jobs:
"+app_update 975370 $BETA_PARAMS validate" \
+quit
tar xjf dfhack-symbols-linux64-build.tar.bz2 -C DF_steam
xml/symbols_gen_linux.sh ${{ inputs.version }} STEAM DF_steam
xml/symbols_gen_linux.sh ${{ inputs.version == 'auto' && '50.0' || inputs.version }} STEAM DF_steam
if [ "${{ inputs.version }}" = "auto" ]; then
cd DF_steam
DFHACK_DISABLE_CONSOLE=1 ./dfhack &
while ! ./dfhack-run lua 'print(scr)' | fgrep 'viewscreen_titlest' 2>/dev/null; do
echo "waiting for DF to start"
sleep 0.5
done
df_ver=`./dfhack-run lua print(dfhack.gui.getDFViewscreen(true).str_version)`
sed -i "s/v0.50.0 linux64 STEAM/v0.${df_ver} linux64 STEAM/" ../xml/symbols.xml
fi
# Itch
- name: Generate Itch symbols
if: inputs.channel == 'all' || inputs.channel == 'itch'
if: (inputs.channel == 'all' || inputs.channel == 'itch') && inputs.version != 'auto'
env:
DISPLAY: :0
ITCH_API_KEY: ${{ secrets.ITCH_API_KEY }}
Expand All @@ -139,7 +162,7 @@ jobs:
# Classic
- name: Generate Classic symbols
if: inputs.channel == 'all' || inputs.channel == 'classic'
if: (inputs.channel == 'all' || inputs.channel == 'classic') && inputs.version != 'auto'
env:
DISPLAY: :0
run: |
Expand Down Expand Up @@ -227,11 +250,11 @@ jobs:
+login $STEAM_USERNAME \
"+app_update 975370 $BETA_PARAMS validate" \
+quit
xml/symbols_gen_windows.sh ${{ inputs.version }} STEAM DF_steam
xml/symbols_gen_windows.sh ${{ inputs.version == 'auto' && '50.0' || inputs.version }} STEAM DF_steam
# Itch
- name: Generate Itch symbols
if: inputs.channel == 'all' || inputs.channel == 'itch'
if: (inputs.channel == 'all' || inputs.channel == 'itch') && inputs.version != 'auto'
env:
ITCH_API_KEY: ${{ secrets.ITCH_API_KEY }}
run: |
Expand All @@ -245,7 +268,7 @@ jobs:
# Classic
- name: Generate Classic symbols
if: inputs.channel == 'all' || inputs.channel == 'classic'
if: (inputs.channel == 'all' || inputs.channel == 'classic') && inputs.version != 'auto'
run: |
mkdir DF_classic
minor=$(echo "${{ inputs.version }}" | cut -d. -f1)
Expand All @@ -272,24 +295,98 @@ jobs:
commit_user_name: DFHack-Urist via GitHub Actions
commit_user_email: [email protected]

auto-ver-windows:
name: Autodetect DF version string (Windows)
if: (inputs.platform == 'all' || inputs.platform == 'windows') && (inputs.channel == 'all' || inputs.channel == 'steam') && inputs.version == 'auto'
needs:
- package-win64
- generate-windows
runs-on: windows-latest
steps:
- name: Clone structures
uses: actions/checkout@v4
with:
repository: DFHack/df-structures
ref: ${{ inputs.structures_ref }}
token: ${{ secrets.DFHACK_GITHUB_TOKEN }}
path: xml
- name: Setup steamcmd
id: steamcmd
uses: CyberAndrii/setup-steamcmd@v1
- name: Update DF version string
env:
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
STEAM_CONFIG_VDF: ${{ secrets.STEAM_CONFIG_VDF }}
STEAM_DF_TESTING: ${{ secrets.STEAM_DF_TESTING }}
STEAM_DF_ADVENTURE_TEST: ${{ secrets.STEAM_DF_ADVENTURE_TEST }}
shell: bash
run: |
mkdir DF_steam
mkdir -p $HOME/Steam/config
echo "$STEAM_CONFIG_VDF" | base64 -d >$HOME/Steam/config/config.vdf
echo "DF steam branch: ${{ inputs.df_steam_branch }}"
if [ "${{ inputs.df_steam_branch }}" = "default" ]; then
BETA_PARAMS=""
elif [ "${{ inputs.df_steam_branch }}" = "testing" ]; then
BETA_PARAMS="-beta testing -betapassword $STEAM_DF_TESTING"
elif [ "${{ inputs.df_steam_branch }}" = "adventure_test" ]; then
BETA_PARAMS="-beta adventure_test -betapassword $STEAM_DF_ADVENTURE_TEST"
else
BETA_PARAMS="-beta ${{ inputs.df_steam_branch }}"
fi
${{ steps.steamcmd.outputs.executable }} \
+@ShutdownOnFailedCommand 1 \
+@sSteamCmdForcePlatformType windows \
+force_install_dir $PWD/DF_steam \
+login $STEAM_USERNAME \
"+app_update 975370 $BETA_PARAMS validate" \
+quit
cd DF_steam
./Dwarf Fortress.exe &
while ! ./dfhack-run.exe lua 'print(scr)' | fgrep 'viewscreen_titlest' 2>/dev/null; do
echo "waiting for DF to start"
sleep 0.5
done
df_ver=`./dfhack-run.exe lua print(dfhack.gui.getDFViewscreen(true).str_version)`
sed -i "s/v0.50.0 win64 STEAM/v0.${df_ver} win64 STEAM/" ../xml/symbols.xml
- name: Merge updates
shell: bash
run: |
cd xml
if ! git diff --exit-code; then
git stash
git pull
git stash pop
fi
- name: Commit symbol updates
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto-update Windows DF version in symbols
repository: xml
commit_user_name: DFHack-Urist via GitHub Actions
commit_user_email: [email protected]

update-ref:
name: Update structures ref
runs-on: ubuntu-latest
needs:
- generate-linux
- generate-windows
- auto-ver-windows
if: ${{ ! failure() }}
steps:
- name: Clone DFHack
uses: actions/checkout@v4
with:
token: ${{ secrets.DFHACK_GITHUB_TOKEN }}
- name: Update ref
shell: bash
run: |
git submodule update --init --no-single-branch library/xml
cd library/xml
git checkout ${{ inputs.structures_ref }}
git pull
echo DETECTED_DF_VER=`git diff symbols.xml | grep -E "^[+][^']+'v0[.]" | head -n1 | sed -r "s/.*name='v0.([^ ]+) .*/\1/"` >>$GITHUB_ENV
- name: Commit ref update
uses: stefanzweifel/git-auto-commit-action@v5
with:
Expand All @@ -301,4 +398,4 @@ jobs:
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh workflow run steam-deploy.yml -R DFHack/dfhack -r ${{ github.ref }} -f version=${{ inputs.version }} -f steam_branch=${{ inputs.steam_branch }}
run: echo gh workflow run steam-deploy.yml -R DFHack/dfhack -r ${{ github.ref }} -f version=${{ env.DETECTED_DF_VER }} -f steam_branch=${{ inputs.steam_branch }}
25 changes: 10 additions & 15 deletions .github/workflows/watch-df-steam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,27 @@ jobs:
strategy:
fail-fast: false
matrix:
# dfhack_ref: leave blank if no structures update is desired
# structures_ref: leave blank to default to master
# steam_branch: leave blank if no steam push is desired
# df_steam_branch: which DF Steam branch to watch
# platform: leave blank to default to all
# channel: leave blank to default to all; should usually be steam
# structures_ref: leave blank to default to master
# dfhack_ref: leave blank if no structures update is desired
# steam_branch: leave blank if no DFHack steam push is desired
include:
- df_steam_branch: public
version: public
- df_steam_branch: beta
version: 51.01-beta
channel: steam
dfhack_ref: adv-beta
structures_ref: adv-beta
dfhack_ref: adv-beta
steam_branch: adventure-beta
- df_steam_branch: testing
version: testing
channel: steam
dfhack_ref: testing
structures_ref: testing
dfhack_ref: testing
steps:
- name: Fetch state
uses: actions/cache/restore@v4
with:
path: state
key: watchstate-${{ matrix.version }}
restore-keys: watchstate-${{ matrix.version }}
key: watchstate-${{ matrix.df_steam_branch }}
restore-keys: watchstate-${{ matrix.df_steam_branch }}
- name: Compare branch metadata
uses: nick-fields/retry@v3
with:
Expand Down Expand Up @@ -77,9 +72,9 @@ jobs:
-R DFHack/dfhack \
-r ${{ matrix.dfhack_ref }} \
-f structures_ref=${{ matrix.structures_ref }} \
-f version=${{ matrix.version }} \
-f version=auto \
-f platform=${{ matrix.platform }} \
-f channel=${{ matrix.channel }} \
-f channel=steam \
-f df_steam_branch=${{ matrix.df_steam_branch }} \
-f steam_branch=${{ matrix.steam_branch }}
- name: Save state
Expand Down
1 change: 1 addition & 0 deletions library/include/DataDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ distribution.
#include <vector>

#include "BitArray.h"
#include "Export.h"

typedef struct lua_State lua_State;

Expand Down
1 change: 1 addition & 0 deletions plugins/buildingplan/itemfilter.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "itemfilter.h"

#include "Debug.h"
#include "MiscUtils.h"

#include "df/item.h"

Expand Down
2 changes: 2 additions & 0 deletions plugins/buildingplan/itemfilter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include "ColorText.h"

#include "modules/Materials.h"

#include "df/dfhack_material_category.h"
Expand Down
1 change: 1 addition & 0 deletions plugins/pathable.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "Debug.h"
#include "Error.h"
#include "PluginManager.h"
#include "TileTypes.h"

Expand Down
1 change: 1 addition & 0 deletions plugins/plant.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Grow and remove shrubs or trees.

#include "Debug.h"
#include "Error.h"
#include "LuaTools.h"
#include "PluginManager.h"
#include "TileTypes.h"
Expand Down
1 change: 1 addition & 0 deletions plugins/regrass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "DataDefs.h"
#include "Debug.h"
#include "Error.h"
#include "LuaTools.h"
#include "PluginManager.h"
#include "TileTypes.h"
Expand Down
2 changes: 2 additions & 0 deletions plugins/stockpiles/OrganicMatLookup.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include "ColorText.h"

#include "modules/Materials.h"

#include "df/organic_mat_category.h"
Expand Down
1 change: 1 addition & 0 deletions plugins/xlsxreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <xlsxio_read.h>

#include "DataFuncs.h"
#include "Error.h"
#include "LuaTools.h"
#include "PluginManager.h"
#include "PluginStatics.h"
Expand Down

0 comments on commit 8116ed6

Please sign in to comment.