6868 name : Build win64
6969 runs-on : windows-2022
7070 steps :
71- # - name: Install dependencies
72- # run: |
73- # sudo apt-get update
74- # sudo apt-get install ccache
7571 - name : Clone DFHack
7672 uses : actions/checkout@v4
7773 with :
@@ -108,15 +104,22 @@ jobs:
108104 ref : main
109105 ssh-key : ${{ secrets.DFHACK_3RDPARTY_TOKEN }}
110106 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
107+ - uses : ilammy/msvc-dev-cmd@v1
108+ - name : Install Build Dependencies
109+ run : |
110+ pip3 install --compile sphinx
111+ pip3 install six
112+ choco install sccache
113+ - name : Prepare Environment
114+ run : |
115+ mkdir -p /output
116+ mkdir -p /pdb
117+ - name : Configure sccache
118+ uses : actions/github-script@v7
119+ with :
120+ script : |
121+ core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
122+ core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
120123 - name : Configure DFHack
121124 env :
122125 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' || '' }}
@@ -125,49 +128,42 @@ jobs:
125128 run : |
126129 cmake -S . `
127130 -B build `
128- -DCMAKE_BUILD_ARCH=64 `
131+ -GNinja `
132+ -DDFHACK_BUILD_ARCH=64 `
129133 -DCMAKE_BUILD_TYPE=Release `
130- ${CMAKE_EXTRA_ARGS}
134+ -DBUILD_DOCS=1 `
135+ -DCMAKE_INSTALL_PREFIX=/output `
136+ -DCMAKE_C_COMPILER_LAUNCHER=sccache `
137+ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache `
138+ $CMAKE_EXTRA_ARGS
131139 - name : Build DFHack
132140 run : |
133141 cmake --build build
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
142+ - name : Format artifact name
143+ if : inputs.artifact-name
144+ id : artifactname
145+ run : |
146+ if test "false" = "${{ inputs.append-date-and-hash }}"; then
147+ echo name=${{ inputs.artifact-name }} >> $GITHUB_OUTPUT
148+ else
149+ echo name=${{ inputs.artifact-name }}-$(date +%Y%m%d)-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
150+ fi
151+ - name : Prep artifact
152+ if : inputs.artifact-name
153+ run : |
154+ Get-ChildItem -Recurse -File -Fitler *.pdb |
155+ Copy-Item -Destination "/pdb"
156+ cd /output
157+ tar cjf /${{ steps.artifactname.outputs.name }}.tar.bz2 .
158+ - name : Upload artifact
159+ if : inputs.artifact-name
160+ uses : actions/upload-artifact@v4
161+ with :
162+ name : ${{ steps.artifactname.outputs.name }}
163+ path : /${{ steps.artifactname.outputs.name }}.tar.bz2
164+ - name : Upload PDBs
165+ if : inputs.artifact-name && inputs.cache-id == 'release'
166+ uses : actions/upload-artifact@v4
167+ with :
168+ name : ${{ steps.artifactname.outputs.name }}_pdb
169+ path : /pdb
0 commit comments