Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Merge branch 'SDUQD-SNA:master' into master #11

Merge branch 'SDUQD-SNA:master' into master

Merge branch 'SDUQD-SNA:master' into master #11

Workflow file for this run

# 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\Release
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
- name: Restore the Wpf application
run: msbuild ${{ env.solutionPath }} /t:Restore /p:Configuration=${{ env.Configuration }} /p:RuntimeIdentifier=win
- name: Build wapproj
run: msbuild ${{ env.solutionPath }} /p:Configuration=${{env.Configuration}} /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