Skip to content

Commit 255a1fc

Browse files
committed
Merge branch 'develop' into myk_hawkowl
2 parents 3327ba1 + aba5ddb commit 255a1fc

File tree

721 files changed

+42275
-37323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

721 files changed

+42275
-37323
lines changed

.github/release_template.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#### Q: How do I download DFHack?
2+
**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`.
3+
4+
-------------
5+
6+
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/).
7+
8+
- [Install DFHack from Steam](https://store.steampowered.com/app/2346660/DFHack)
9+
- [Manual install](https://docs.dfhack.org/en/stable/docs/Installing.html#installing)
10+
- [Quickstart guide (for players)](https://docs.dfhack.org/en/stable/docs/Quickstart.html#quickstart)
11+
- [Modding guide (for modders)](https://docs.dfhack.org/en/stable/docs/guides/modding-guide.html)
12+
13+
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!
14+
15+
Highlights
16+
----------------------------------
17+
18+
<details>
19+
<summary>Highlight 1, Highlight 2</summary>
20+
21+
### Highlight 1
22+
23+
Demo screenshot/vidcap
24+
25+
Text
26+
27+
### Highlight 2
28+
29+
Demo screenshot/vidcap
30+
31+
Text
32+
33+
</details>
34+
35+
Announcements
36+
----------------------------------
37+
38+
<details>
39+
<summary>Annc 1, PSAs</summary>
40+
41+
### Annc 1
42+
43+
Text
44+
45+
### PSAs
46+
47+
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.
48+
49+
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".
50+
51+
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.
52+
53+
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.
54+
55+
</details>
56+
57+
Generated release notes
58+
====================
59+
60+
<details>
61+
<summary>New tools, fixes, and improvements</summary>
62+
63+
%RELEASE_NOTES%
64+
</details>

.github/workflows/build-linux.yml

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
name: Build linux64
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
dfhack_ref:
7+
type: string
8+
scripts_ref:
9+
type: string
10+
structures_ref:
11+
type: string
12+
artifact-name:
13+
type: string
14+
append-date-and-hash:
15+
type: boolean
16+
default: false
17+
cache-id:
18+
type: string
19+
default: ''
20+
cache-readonly:
21+
type: boolean
22+
default: false
23+
platform-files:
24+
type: boolean
25+
default: true
26+
common-files:
27+
type: boolean
28+
default: true
29+
docs:
30+
type: boolean
31+
default: false
32+
html:
33+
type: boolean
34+
default: true
35+
stonesense:
36+
type: boolean
37+
default: false
38+
extras:
39+
type: boolean
40+
default: false
41+
tests:
42+
type: boolean
43+
default: false
44+
xml-dump-type-sizes:
45+
type: boolean
46+
default: false
47+
gcc-ver:
48+
type: string
49+
default: "10"
50+
51+
jobs:
52+
build-linux64:
53+
name: Build linux64
54+
runs-on: ubuntu-22.04
55+
steps:
56+
- name: Install basic build dependencies
57+
run: |
58+
sudo apt-get update
59+
sudo apt-get install ninja-build
60+
- name: Install binary build dependencies
61+
if: inputs.platform-files || inputs.xml-dump-type-sizes
62+
run: |
63+
sudo apt-get install \
64+
ccache \
65+
gcc-${{ inputs.gcc-ver }} \
66+
g++-${{ inputs.gcc-ver }} \
67+
libxml-libxslt-perl
68+
- name: Install stonesense dependencies
69+
if: inputs.stonesense
70+
run: sudo apt-get install libgl-dev
71+
- name: Install doc dependencies
72+
if: inputs.docs
73+
run: pip install 'sphinx<4.4.0'
74+
- name: Clone DFHack
75+
uses: actions/checkout@v3
76+
with:
77+
repository: ${{ inputs.dfhack_ref && github.repository || 'DFHack/dfhack' }}
78+
ref: ${{ inputs.dfhack_ref }}
79+
submodules: true
80+
fetch-depth: ${{ !inputs.platform-files && 1 || 0 }}
81+
- name: Clone scripts
82+
if: inputs.scripts_ref
83+
uses: actions/checkout@v3
84+
with:
85+
repository: ${{ inputs.scripts_ref && github.repository || 'DFHack/scripts' }}
86+
ref: ${{ inputs.scripts_ref }}
87+
path: scripts
88+
- name: Clone structures
89+
if: inputs.structures_ref
90+
uses: actions/checkout@v3
91+
with:
92+
repository: ${{ inputs.structures_ref && github.repository || 'DFHack/df-structures' }}
93+
ref: ${{ inputs.structures_ref }}
94+
path: library/xml
95+
- name: Fetch ccache
96+
if: inputs.platform-files
97+
uses: actions/cache/restore@v3
98+
with:
99+
path: ~/.cache/ccache
100+
key: linux-gcc-${{ inputs.gcc-ver }}-${{ inputs.cache-id }}-${{ github.sha }}
101+
restore-keys: |
102+
linux-gcc-${{ inputs.gcc-ver }}-${{ inputs.cache-id }}
103+
linux-gcc-${{ inputs.gcc-ver }}
104+
- name: Configure DFHack
105+
env:
106+
CC: gcc-${{ inputs.gcc-ver }}
107+
CXX: g++-${{ inputs.gcc-ver }}
108+
run: |
109+
cmake \
110+
-S . \
111+
-B build \
112+
-G Ninja \
113+
-DCMAKE_INSTALL_PREFIX=build/image \
114+
-DCMAKE_BUILD_TYPE=Release \
115+
${{ inputs.platform-files && '-DCMAKE_C_COMPILER_LAUNCHER=ccache' || '' }} \
116+
${{ inputs.platform-files && '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache' || '' }} \
117+
-DBUILD_LIBRARY:BOOL=${{ inputs.platform-files }} \
118+
-DBUILD_PLUGINS:BOOL=${{ inputs.platform-files }} \
119+
-DBUILD_STONESENSE:BOOL=${{ inputs.stonesense }} \
120+
-DBUILD_DEV_PLUGINS:BOOL=${{ inputs.extras }} \
121+
-DBUILD_SIZECHECK:BOOL=${{ inputs.extras }} \
122+
-DBUILD_SKELETON:BOOL=${{ inputs.extras }} \
123+
-DBUILD_DOCS:BOOL=${{ inputs.docs }} \
124+
-DBUILD_DOCS_NO_HTML:BOOL=${{ !inputs.html }} \
125+
-DBUILD_TESTS:BOOL=${{ inputs.tests }} \
126+
-DBUILD_XMLDUMP:BOOL=${{ inputs.xml-dump-type-sizes }} \
127+
${{ inputs.xml-dump-type-sizes && '-DINSTALL_XMLDUMP:BOOL=1' || ''}} \
128+
-DINSTALL_DATA_FILES:BOOL=${{ inputs.common-files }} \
129+
-DINSTALL_SCRIPTS:BOOL=${{ inputs.common-files }}
130+
- name: Build DFHack
131+
run: ninja -C build install
132+
- name: Run cpp tests
133+
if: inputs.platform-files
134+
run: ninja -C build test
135+
- name: Finalize cache
136+
if: inputs.platform-files
137+
run: |
138+
ccache --show-stats --verbose
139+
ccache --max-size 40M
140+
ccache --cleanup
141+
ccache --max-size 500M
142+
ccache --zero-stats
143+
- name: Save ccache
144+
if: inputs.platform-files && !inputs.cache-readonly
145+
uses: actions/cache/save@v3
146+
with:
147+
path: ~/.cache/ccache
148+
key: linux-gcc-${{ inputs.gcc-ver }}-${{ inputs.cache-id }}-${{ github.sha }}
149+
- name: Format artifact name
150+
if: inputs.artifact-name
151+
id: artifactname
152+
run: |
153+
if test "false" = "${{ inputs.append-date-and-hash }}"; then
154+
echo name=${{ inputs.artifact-name }} >> $GITHUB_OUTPUT
155+
else
156+
echo name=${{ inputs.artifact-name }}-$(date +%Y%m%d)-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
157+
fi
158+
- name: Prep artifact
159+
if: inputs.artifact-name
160+
run: |
161+
cd build/image
162+
tar cjf ../../${{ steps.artifactname.outputs.name }}.tar.bz2 .
163+
- name: Upload artifact
164+
if: inputs.artifact-name
165+
uses: actions/upload-artifact@v3
166+
with:
167+
name: ${{ steps.artifactname.outputs.name }}
168+
path: ${{ steps.artifactname.outputs.name }}.tar.bz2
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: Build win64
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
dfhack_ref:
7+
type: string
8+
scripts_ref:
9+
type: string
10+
structures_ref:
11+
type: string
12+
artifact-name:
13+
type: string
14+
append-date-and-hash:
15+
type: boolean
16+
default: false
17+
cache-id:
18+
type: string
19+
default: ''
20+
cache-readonly:
21+
type: boolean
22+
default: false
23+
platform-files:
24+
type: boolean
25+
default: true
26+
common-files:
27+
type: boolean
28+
default: true
29+
docs:
30+
type: boolean
31+
default: false
32+
html:
33+
type: boolean
34+
default: true
35+
stonesense:
36+
type: boolean
37+
default: false
38+
tests:
39+
type: boolean
40+
default: false
41+
xml-dump-type-sizes:
42+
type: boolean
43+
default: false
44+
launchdf:
45+
type: boolean
46+
default: false
47+
48+
49+
jobs:
50+
build-win64:
51+
name: Build win64
52+
runs-on: ubuntu-22.04
53+
steps:
54+
- name: Install dependencies
55+
run: |
56+
sudo apt-get update
57+
sudo apt-get install ccache
58+
- name: Clone DFHack
59+
uses: actions/checkout@v3
60+
with:
61+
repository: ${{ inputs.dfhack_ref && github.repository || 'DFHack/dfhack' }}
62+
ref: ${{ inputs.dfhack_ref }}
63+
submodules: true
64+
fetch-depth: 0
65+
- name: Clone scripts
66+
if: inputs.scripts_ref
67+
uses: actions/checkout@v3
68+
with:
69+
repository: ${{ inputs.scripts_ref && github.repository || 'DFHack/scripts' }}
70+
ref: ${{ inputs.scripts_ref }}
71+
path: scripts
72+
- name: Clone structures
73+
if: inputs.structures_ref
74+
uses: actions/checkout@v3
75+
with:
76+
repository: ${{ inputs.structures_ref && github.repository || 'DFHack/df-structures' }}
77+
ref: ${{ inputs.structures_ref }}
78+
path: library/xml
79+
- name: Get 3rd party SDKs
80+
if: inputs.launchdf
81+
uses: actions/checkout@v3
82+
with:
83+
repository: DFHack/3rdparty
84+
ref: main
85+
ssh-key: ${{ secrets.DFHACK_3RDPARTY_TOKEN }}
86+
path: depends/steam
87+
- name: Fetch ccache
88+
if: inputs.platform-files
89+
uses: actions/cache/restore@v3
90+
with:
91+
path: build/win64-cross/ccache
92+
key: win-msvc-${{ inputs.cache-id }}-${{ github.sha }}
93+
restore-keys: |
94+
win-msvc-${{ inputs.cache-id }}
95+
win-msvc
96+
- name: Cross-compile
97+
env:
98+
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' || '' }}
99+
run: |
100+
cd build
101+
bash -x build-win64-from-linux.sh
102+
- name: Finalize cache
103+
run: |
104+
cd build
105+
ccache -d win64-cross/ccache --show-stats --verbose
106+
ccache -d win64-cross/ccache --max-size 150M
107+
ccache -d win64-cross/ccache --cleanup
108+
ccache -d win64-cross/ccache --max-size 500M
109+
ccache -d win64-cross/ccache --zero-stats
110+
- name: Save ccache
111+
if: inputs.platform-files && !inputs.cache-readonly
112+
uses: actions/cache/save@v3
113+
with:
114+
path: build/win64-cross/ccache
115+
key: win-msvc-${{ inputs.cache-id }}-${{ github.sha }}
116+
- name: Format artifact name
117+
if: inputs.artifact-name
118+
id: artifactname
119+
run: |
120+
if test "false" = "${{ inputs.append-date-and-hash }}"; then
121+
echo name=${{ inputs.artifact-name }} >> $GITHUB_OUTPUT
122+
else
123+
echo name=${{ inputs.artifact-name }}-$(date +%Y%m%d)-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
124+
fi
125+
- name: Prep artifact
126+
if: inputs.artifact-name
127+
run: |
128+
cd build/win64-cross/output
129+
tar cjf ../../../${{ steps.artifactname.outputs.name }}.tar.bz2 .
130+
- name: Upload artifact
131+
if: inputs.artifact-name
132+
uses: actions/upload-artifact@v3
133+
with:
134+
name: ${{ steps.artifactname.outputs.name }}
135+
path: ${{ steps.artifactname.outputs.name }}.tar.bz2

0 commit comments

Comments
 (0)