This repository has been archived by the owner on Feb 29, 2024. It is now read-only.
Merge branch 'SDUQD-SNA:master' into master #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) SduNetCheckTool | |
# Copyright (c) Microsoft Corporation. | |
# Licensed under the MIT license. | |
name: Build and Pack | |
on: | |
push: | |
branches: | |
- master | |
workflow_call: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
targetplatform: [x64] | |
Configuration: [Release] | |
runs-on: windows-latest | |
env: | |
# artifacts 命名 [名字]-[commit-hash] | |
artifactName: SduNetCheckTool-${{ github.sha }} | |
appPackagesArchive: SduNetCheckTool-${{ github.sha }}.zip | |
appPackagesExecutable: SduNetCheckTool-${{ github.sha }}.exe | |
solutionPath: SduNetCheckTool.sln | |
coreProjectDirectory: SduNetCheckTool.Core | |
guiProjectDirectory: SduNetCheckTool.GUI | |
coreProjectPath: SduNetCheckTool.Core\SduNetCheckTool.Core.csproj | |
guiProjectPath: SduNetCheckTool.GUI\SduNetCheckTool.GUI.csproj | |
Configuration: Release | |
appPackagesDirectory: bin\x64\Release | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Setup MSBuild.exe | |
uses: microsoft/[email protected] | |
- name: Restore the Wpf application | |
run: msbuild ${{ env.solutionPath }} /t:Restore /p:Configuration=Release /p:Platform=x64 /p:RuntimeIdentifier=win-x64 | |
- name: Build wapproj | |
run: msbuild ${{ env.solutionPath }} /p:Configuration=${{env.Configuration}} /p:Platform=x64 /p:RuntimIdentifier=win /p:UapAppxPackageBuildMode=StoreUpload /p:AppxBundle=Never /p:GenerateAppInstallerFile=False /p:AppxPackageSigningEnabled=False | |
- name: Create archive | |
run: | | |
mkdir build | |
Compress-Archive -Path ${{ env.guiProjectDirectory }}\${{ env.appPackagesDirectory }}\* -DestinationPath build\${{ env.appPackagesArchive }} | |
- name: Pack into single file executable | |
run: | | |
cd .\.github\utils\ | |
npm install | |
node pack.js | |
cd - | |
Move-Item build\SduNetCheckTool.GUI_boxed.exe build\${{ env.appPackagesExecutable }} | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.artifactName }} | |
path: | | |
build/${{ env.appPackagesArchive }} | |
build/${{ env.appPackagesExecutable }} | |
retention-days: 1 |