This repository has been archived by the owner on Feb 29, 2024. It is now read-only.
Merge branch 'dev' #36
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 命名 [名字]-[build-number]-[commit-hash] | |
artifactName: SduNetCheckTool-build.${{github.run_number}}-${{ github.sha }} | |
appPackagesExecutable: SduNetCheckTool-build.${{github.run_number}}-${{ github.sha }}.exe | |
solutionPath: SduNetCheckTool.sln | |
guiProjectDirectory: SduNetCheckTool.GUI | |
Platform: x64 | |
Configuration: Release | |
RuntimeIdentifier: win-x64 | |
# appPackagesDirectory: bin\x64\Release | |
appPackagesDirectory: bin\$env:Platform\$env:Configuration | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '3.1.x' | |
- name: Setup MSBuild.exe | |
uses: microsoft/setup-msbuild@v2 | |
- name: Add Costura.Fody | |
run: dotnet add package Costura.Fody | |
- name: Restore and build the Wpf application | |
run: ./.github/utils/build.ps1 -SolutionPath ${{ env.solutionPath }} -Configuration ${{ env.Configuration }} -Platform ${{ env.Platform }} -RuntimeIdentifier ${{ env.RuntimeIdentifier }} | |
- name: Rename file | |
run: | | |
mkdir build | |
Compress-Archive -Path ${{ env.guiProjectDirectory }}\${{ env.appPackagesDirectory }}\app.publish\SduNetCheckTool.GUI.exe -DestinationPath build\${{ env.appPackagesExecutable }} | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.artifactName }} | |
path: | | |
build/${{ env.appPackagesExecutable }} | |
retention-days: 15 |