Skip to content

Commit 68b7619

Browse files
committed
Initial winnative test
1 parent 004b4dd commit 68b7619

File tree

1 file changed

+64
-56
lines changed

1 file changed

+64
-56
lines changed

.github/workflows/build-windows.yml

Lines changed: 64 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ on:
6666
jobs:
6767
build-win64:
6868
name: Build win64
69-
runs-on: ubuntu-22.04
69+
runs-on: windows-2022
7070
steps:
71-
- name: Install dependencies
72-
run: |
73-
sudo apt-get update
74-
sudo apt-get install ccache
71+
# - name: Install dependencies
72+
# run: |
73+
# sudo apt-get update
74+
# sudo apt-get install ccache
7575
- name: Clone DFHack
7676
uses: actions/checkout@v4
7777
with:
@@ -108,58 +108,66 @@ jobs:
108108
ref: main
109109
ssh-key: ${{ secrets.DFHACK_3RDPARTY_TOKEN }}
110110
path: depends/steam
111-
- name: Fetch ccache
112-
if: inputs.platform-files
113-
uses: actions/cache/restore@v4
114-
with:
115-
path: build/win64-cross/ccache
116-
key: win-msvc-${{ inputs.cache-id }}-${{ github.sha }}
117-
restore-keys: |
118-
win-msvc-${{ inputs.cache-id }}
119-
win-msvc
120-
- name: Cross-compile
111+
# - name: Fetch ccache
112+
# if: inputs.platform-files
113+
# uses: actions/cache/restore@v4
114+
# with:
115+
# path: build/win64-cross/ccache
116+
# key: win-msvc-${{ inputs.cache-id }}-${{ github.sha }}
117+
# restore-keys: |
118+
# win-msvc-${{ inputs.cache-id }}
119+
# win-msvc
120+
- name: Configure DFHack
121121
env:
122122
CMAKE_EXTRA_ARGS: -DBUILD_PDBS:BOOL=${{ inputs.cache-id == 'release' }} -DDFHACK_RUN_URL='https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' -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' || '' }}
123+
CC: cl
124+
CXX: cl
123125
run: |
124-
cd build
125-
bash -x build-win64-from-linux.sh
126-
- name: Finalize cache
127-
run: |
128-
cd build
129-
ccache -d win64-cross/ccache --show-stats --verbose
130-
ccache -d win64-cross/ccache --max-size ${{ inputs.cache-id == 'release' && '500M' || '150M' }}
131-
ccache -d win64-cross/ccache --cleanup
132-
ccache -d win64-cross/ccache --max-size ${{ inputs.cache-id == 'release' && '2G' || '500M' }}
133-
ccache -d win64-cross/ccache --zero-stats
134-
- name: Save ccache
135-
if: inputs.platform-files && !inputs.cache-readonly
136-
uses: actions/cache/save@v4
137-
with:
138-
path: build/win64-cross/ccache
139-
key: win-msvc-${{ inputs.cache-id }}-${{ github.sha }}
140-
- name: Format artifact name
141-
if: inputs.artifact-name
142-
id: artifactname
126+
cmake -S . \
127+
-B build \
128+
-DCMAKE_BUILD_ARCH=64 \
129+
-DCMAKE_BUILD_TYPE=Release \
130+
${CMAKE_EXTRA_ARGS}
131+
- name: Build DFHack
143132
run: |
144-
if test "false" = "${{ inputs.append-date-and-hash }}"; then
145-
echo name=${{ inputs.artifact-name }} >> $GITHUB_OUTPUT
146-
else
147-
echo name=${{ inputs.artifact-name }}-$(date +%Y%m%d)-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
148-
fi
149-
- name: Prep artifact
150-
if: inputs.artifact-name
151-
run: |
152-
cd build/win64-cross/output
153-
tar cjf ../../../${{ steps.artifactname.outputs.name }}.tar.bz2 .
154-
- name: Upload artifact
155-
if: inputs.artifact-name
156-
uses: actions/upload-artifact@v4
157-
with:
158-
name: ${{ steps.artifactname.outputs.name }}
159-
path: ${{ steps.artifactname.outputs.name }}.tar.bz2
160-
- name: Upload PDBs
161-
if: inputs.artifact-name && inputs.cache-id == 'release'
162-
uses: actions/upload-artifact@v4
163-
with:
164-
name: ${{ steps.artifactname.outputs.name }}_pdb
165-
path: build/win64-cross/pdb
133+
cmake --build VC2022 -t ALL_BUILD -- /m /p:Platform=x64 /p:Configuration=Release
134+
# - name: Finalize cache
135+
# run: |
136+
# cd build
137+
# ccache -d win64-cross/ccache --show-stats --verbose
138+
# ccache -d win64-cross/ccache --max-size ${{ inputs.cache-id == 'release' && '500M' || '150M' }}
139+
# ccache -d win64-cross/ccache --cleanup
140+
# ccache -d win64-cross/ccache --max-size ${{ inputs.cache-id == 'release' && '2G' || '500M' }}
141+
# ccache -d win64-cross/ccache --zero-stats
142+
# - name: Save ccache
143+
# if: inputs.platform-files && !inputs.cache-readonly
144+
# uses: actions/cache/save@v4
145+
# with:
146+
# path: build/win64-cross/ccache
147+
# key: win-msvc-${{ inputs.cache-id }}-${{ github.sha }}
148+
# - name: Format artifact name
149+
# if: inputs.artifact-name
150+
# id: artifactname
151+
# run: |
152+
# if test "false" = "${{ inputs.append-date-and-hash }}"; then
153+
# echo name=${{ inputs.artifact-name }} >> $GITHUB_OUTPUT
154+
# else
155+
# echo name=${{ inputs.artifact-name }}-$(date +%Y%m%d)-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
156+
# fi
157+
# - name: Prep artifact
158+
# if: inputs.artifact-name
159+
# run: |
160+
# cd build/win64-cross/output
161+
# tar cjf ../../../${{ steps.artifactname.outputs.name }}.tar.bz2 .
162+
# - name: Upload artifact
163+
# if: inputs.artifact-name
164+
# uses: actions/upload-artifact@v4
165+
# with:
166+
# name: ${{ steps.artifactname.outputs.name }}
167+
# path: ${{ steps.artifactname.outputs.name }}.tar.bz2
168+
# - name: Upload PDBs
169+
# if: inputs.artifact-name && inputs.cache-id == 'release'
170+
# uses: actions/upload-artifact@v4
171+
# with:
172+
# name: ${{ steps.artifactname.outputs.name }}_pdb
173+
# path: build/win64-cross/pdb

0 commit comments

Comments
 (0)