1 Star 0 Fork 1

My_Component/NETworkManager

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
appveyor.yml 4.49 KB
一键复制 编辑 原始数据 按行查看 历史
BornToBeRoot 提交于 2024-04-27 22:19 . CI: Test setup file
image: Visual Studio 2022
#branches:
# only:
# - main
configuration: Release
platform: x64
install:
- git submodule update --init
before_build:
- dotnet restore %APPVEYOR_BUILD_FOLDER%\Source\NETworkManager.sln
- ps: |
# Update the version based on the current date (e.g. 2024.4.27.0)
$Date = Get-Date
$VersionString = "$($Date.Year).$($Date.Month).$($Date.Day).0"
Write-Host "Set NETworkManager version set to $VersionString"
# Update assembly version
$PatternVersion = '\[assembly: AssemblyVersion\("(.*)"\)\]'
$PatternFileVersion = '\[assembly: AssemblyFileVersion\("(.*)"\)\]'
$AssemblyFile = "$($env:APPVEYOR_BUILD_FOLDER)\Source\GlobalAssemblyInfo.cs"
$AssemlbyContent = Get-Content -Path $AssemblyFile -Encoding utf8
$AssemlbyContent = $AssemlbyContent -replace $PatternVersion, "[assembly: AssemblyVersion(""$($VersionString)"")]"
$AssemlbyContent = $AssemlbyContent -replace $PatternFileVersion, "[assembly: AssemblyFileVersion(""$($VersionString)"")]"
$AssemlbyContent | Set-Content -Path $AssemblyFile -Encoding utf8
# Update inno setup version
$PatternSetupVersion = '#define MyAppVersion "(.*)"'
$InnoSetupFile = ".\InnoSetup.iss"
$SetupContent = Get-Content -Path "$InnoSetupFile" -Encoding utf8
$SetupContent = $SetupContent -replace $PatternSetupVersion, "#define MyAppVersion ""$($VersionString)"""
$SetupContent | Set-Content -Path "$InnoSetupFile" -Encoding utf8
build_script:
- dotnet build %APPVEYOR_BUILD_FOLDER%\Source\NETworkManager.sln --configuration Release --no-restore
after_build:
- ps: |
if($env:APPVEYOR_REPO_TAG -eq $false) {
Write-Host "Release build is skipped because no tag was found!"
return
}
# Copy build
New-Item -Path "$($env:APPVEYOR_BUILD_FOLDER)\Build\NETworkManager" -ItemType Directory -Force | Out-Null
Copy-Item -Path "$($env:APPVEYOR_BUILD_FOLDER)\Source\NETworkManager\bin\Release\net8.0-windows10.0.17763.0\win-x64\*" -Destination "$($env:APPVEYOR_BUILD_FOLDER)\Build\NETworkManager" -Recurse -Force
# Cleanup build
Get-ChildItem -Path "$($env:APPVEYOR_BUILD_FOLDER)\Build\NETworkManager" | Where-Object { $_.Name.EndsWith(".pdb") } | Remove-Item
Remove-Item -Path "$($env:APPVEYOR_BUILD_FOLDER)\Build\NETworkManager\WebView2Loader.dll"
# Version
$Version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$($env:APPVEYOR_BUILD_FOLDER)\Build\NETworkManager\NETworkManager.exe").FileVersion
# Create archive
##Compress-Archive -Path "$($env:APPVEYOR_BUILD_FOLDER)\Build\NETworkManager" -DestinationPath "$($env:APPVEYOR_BUILD_FOLDER)\Build\NETworkManager_$($Version)_Archive.zip"
# Create portable
##New-Item -Path "$($env:APPVEYOR_BUILD_FOLDER)\Build\NETworkManager" -Name "IsPortable.settings" -ItemType File | Out-Null
##Compress-Archive -Path "$($env:APPVEYOR_BUILD_FOLDER)\Build\NETworkManager" -DestinationPath "$($env:APPVEYOR_BUILD_FOLDER)\Build\NETworkManager_$($Version)_Portable.zip"
##Remove-Item -Path "$($env:APPVEYOR_BUILD_FOLDER)\Build\NETworkManager\IsPortable.settings"
# Create setup
$InnoSetupPath = "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe"
Start-Process -FilePath $InnoSetupPath -ArgumentList """$($env:APPVEYOR_BUILD_FOLDER)\InnoSetup.iss""" -NoNewWindow -Wait
# Create SHA256 file hashes
##foreach ($hash in Get-ChildItem -Path "$($env:APPVEYOR_BUILD_FOLDER)\Build" | Where-Object { $_.Name.EndsWith(".zip") -or $_.Name.EndsWith(".exe") } | Get-FileHash) {
## "$($hash.Algorithm) | $($hash.Hash) | $([System.IO.Path]::GetFileName($hash.Path))" | Out-File -FilePath "$($env:APPVEYOR_BUILD_FOLDER)\Build\NETworkManager_$($Version)_Hash.txt" -Encoding utf8 -Append
##}
##Get-Content -Path "$($env:APPVEYOR_BUILD_FOLDER)\Build\NETworkManager_$($Version)_Hash.txt"
Remove-Item -Path "$($env:APPVEYOR_BUILD_FOLDER)\Build\NETworkManager" -Recurse
Compress-Archive -Path "$($env:APPVEYOR_BUILD_FOLDER)\Build" -DestinationPath "$($env:APPVEYOR_BUILD_FOLDER)\releases_unsigned.zip"
artifacts:
- path: 'releases_unsigned.zip'
deploy:
- provider: Webhook
url: https://app.signpath.io/API/v1/0a191750-608c-457a-a11d-8a5433ad6491/Integrations/AppVeyor?ProjectSlug=NETworkManager&SigningPolicySlug=test-signing&ArtifactConfigurationSlug=initial
authorization:
secure: PF6YBkp3Gg4c9TUX4HOzgjG5FeCzq9hYMCG5Zbs6xEL3jVuWe605D+Q/x1PKtK/q2nxUGzQIvOdiWbXMnUXWQg==
on:
APPVEYOR_REPO_TAG: true
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/netants2018/NETworkManager.git
git@gitee.com:netants2018/NETworkManager.git
netants2018
NETworkManager
NETworkManager
main

搜索帮助