1818 path : resources
1919 key : xray-geodat-
2020
21+ - name : Restore Wintun Cache
22+ uses : actions/cache/restore@v5
23+ with :
24+ path : resources
25+ key : xray-wintun-
26+
2127 - name : Check Assets Existence
2228 id : check-assets
2329 run : |
3440 break
3541 fi
3642 done
43+ LIST=('amd64' 'x86' 'arm64' 'arm')
44+ for ARCHITECTURE in "${LIST[@]}"
45+ do
46+ echo -e "Checking wintun.dll for ${ARCHITECTURE}..."
47+ if [ -s "./resources/wintun/bin/${ARCHITECTURE}/wintun.dll" ]; then
48+ echo -e "wintun.dll for ${ARCHITECTURE} exists."
49+ else
50+ echo -e "wintun.dll for ${ARCHITECTURE} is missing."
51+ echo "missing=true" >> $GITHUB_OUTPUT
52+ break
53+ fi
54+ done
3755
3856 - name : Trigger Asset Update Workflow if Assets Missing
3957 if : steps.check-assets.outputs.missing == 'true'
@@ -191,8 +209,6 @@ jobs:
191209 if [[ ${GOOS} == 'windows' ]]; then
192210 echo 'Building Xray for Windows...'
193211 go build -o build_assets/xray.exe -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main
194- echo 'CreateObject("Wscript.Shell").Run "xray.exe -config config.json",0' > build_assets/xray_no_window.vbs
195- echo 'Start-Process -FilePath ".\xray.exe" -ArgumentList "-config .\config.json" -WindowStyle Hidden' > build_assets/xray_no_window.ps1
196212 # The line below is for without running conhost.exe version. Commented for not being used. Provided for reference.
197213 # go build -o build_assets/wxray.exe -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-H windowsgui -X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main
198214 else
@@ -212,9 +228,36 @@ jobs:
212228 path : resources
213229 key : xray-geodat-
214230
231+ - name : Restore Wintun Cache
232+ if : matrix.goos == 'windows'
233+ uses : actions/cache/restore@v5
234+ with :
235+ path : resources
236+ key : xray-wintun-
237+
238+ - name : Add additional assets into package
239+ run : |
240+ mv -f resources/geo* build_assets/
241+ if [[ ${GOOS} == 'windows' ]]; then
242+ echo 'CreateObject("Wscript.Shell").Run "xray.exe -config config.json",0' > build_assets/xray_no_window.vbs
243+ echo 'Start-Process -FilePath ".\xray.exe" -ArgumentList "-config .\config.json" -WindowStyle Hidden' > build_assets/xray_no_window.ps1
244+ if [[ ${GOARCH} == 'amd64' ]]; then
245+ mv resources/wintun/bin/amd64/wintun.dll build_assets/
246+ fi
247+ if [[ ${GOARCH} == '386' ]]; then
248+ mv resources/wintun/bin/x86/wintun.dll build_assets/
249+ fi
250+ if [[ ${GOARCH} == 'arm64' ]]; then
251+ mv resources/wintun/bin/arm64/wintun.dll build_assets/
252+ fi
253+ if [[ ${GOARCH} == 'arm' ]]; then
254+ mv resources/wintun/bin/arm/wintun.dll build_assets/
255+ fi
256+ mv resources/wintun/LICENSE.txt build_assets/LICENSE-wintun.txt
257+ fi
258+
215259 - name : Copy README.md & LICENSE
216260 run : |
217- mv -f resources/* build_assets
218261 cp ${GITHUB_WORKSPACE}/README.md ./build_assets/README.md
219262 cp ${GITHUB_WORKSPACE}/LICENSE ./build_assets/LICENSE
220263
@@ -233,17 +276,6 @@ jobs:
233276 openssl dgst -$METHOD $FILE | sed 's/([^)]*)//g' >>$DGST
234277 done
235278
236- - name : Change the name
237- run : |
238- mv build_assets Xray-${{ env.ASSET_NAME }}
239-
240- - name : Upload files to Artifacts
241- uses : actions/upload-artifact@v6
242- with :
243- name : Xray-${{ env.ASSET_NAME }}
244- path : |
245- ./Xray-${{ env.ASSET_NAME }}/*
246-
247279 - name : Upload binaries to release
248280 uses : svenstaro/upload-release-action@v2
249281 if : github.event_name == 'release'
@@ -252,3 +284,10 @@ jobs:
252284 file : ./Xray-${{ env.ASSET_NAME }}.zip*
253285 tag : ${{ github.ref }}
254286 file_glob : true
287+
288+ - name : Upload files to Artifacts
289+ uses : actions/upload-artifact@v6
290+ with :
291+ name : Xray-${{ env.ASSET_NAME }}
292+ path : |
293+ ./build_assets/*
0 commit comments