dep: Update mstest monorepo to 3.6.2 #938
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
name: CI | |
on: [push, pull_request, workflow_dispatch] | |
env: | |
ProjectName: ShadowsocksR | |
jobs: | |
build: | |
name: Build | |
runs-on: windows-latest | |
env: | |
SyncfusionLicenseKey: ${{ secrets.SyncfusionLicenseKey }} | |
NET_TFM: net7.0-windows | |
Configuration: Release | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 7.0.x | |
- name: Setup NuGet Private Sources | |
shell: pwsh | |
run: dotnet nuget add source https://nuget.pkg.github.com/HMBSbige/index.json -n GitHub-HMBSbige -u HMBSbige -p ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text | |
- name: Build .NET App | |
shell: pwsh | |
run: .\build.ps1 app | |
- name: Build x64 | |
shell: pwsh | |
run: .\build.ps1 x64 | |
- name: Build x86 | |
shell: pwsh | |
run: .\build.ps1 x86 | |
- name: Upload .NET App | |
continue-on-error: true | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ProjectName }} | |
path: shadowsocks-csharp\bin\${{ env.Configuration }}\${{ env.NET_TFM }}\publish\ | |
- name: Upload x64 | |
continue-on-error: true | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ProjectName }}-Win64 | |
path: shadowsocks-csharp\bin\${{ env.Configuration }}\${{ env.NET_TFM }}\win-x64\publish\ | |
- name: Upload x86 | |
continue-on-error: true | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ProjectName }}-Win32 | |
path: shadowsocks-csharp\bin\${{ env.Configuration }}\${{ env.NET_TFM }}\win-x86\publish\ | |
- name: Get tag | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | |
id: tag | |
uses: dawidd6/action-get-tag@v1 | |
- name: Package .NET App | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | |
shell: pwsh | |
run: | | |
New-Item -ItemType Directory -Path C:\builtfiles -Force > $null | |
$zip_path = "C:\builtfiles\$env:ProjectName-${{ steps.tag.outputs.tag }}.7z" | |
7z a -mx9 "$zip_path" ".\shadowsocks-csharp\bin\$env:Configuration\$env:NET_TFM\publish\" | |
7z rn "$zip_path" publish $env:ProjectName | |
echo "NET_SHA256=$((Get-FileHash $zip_path -Algorithm SHA256).Hash)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Package x64 | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | |
shell: pwsh | |
run: | | |
New-Item -ItemType Directory -Path C:\builtfiles -Force > $null | |
$zip_path = "C:\builtfiles\$env:ProjectName-Win64-${{ steps.tag.outputs.tag }}.7z" | |
7z a -mx9 "$zip_path" ".\shadowsocks-csharp\bin\$env:Configuration\$env:NET_TFM\win-x64\publish\" | |
7z rn "$zip_path" publish $env:ProjectName | |
echo "NET64_SHA256=$((Get-FileHash $zip_path -Algorithm SHA256).Hash)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Package x86 | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | |
shell: pwsh | |
run: | | |
New-Item -ItemType Directory -Path C:\builtfiles -Force > $null | |
$zip_path = "C:\builtfiles\$env:ProjectName-Win32-${{ steps.tag.outputs.tag }}.7z" | |
7z a -mx9 "$zip_path" ".\shadowsocks-csharp\bin\$env:Configuration\$env:NET_TFM\win-x86\publish\" | |
7z rn "$zip_path" publish $env:ProjectName | |
echo "NET86_SHA256=$((Get-FileHash $zip_path -Algorithm SHA256).Hash)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Create a new GitHub release if a new tag is pushed | |
uses: ncipollo/release-action@v1 | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: v${{ steps.tag.outputs.tag }} | |
prerelease: true | |
draft: false | |
artifacts: C:\builtfiles\* | |
body: | | |
[![](https://img.shields.io/badge/Channel-blue?label=Telegram&logo=telegram)](https://t.me/ShadowsocksR_Windows) [![](https://img.shields.io/badge/Group-green?label=Telegram&logo=telegram)](https://t.me/joinchat/Gn-Aa0-j4HcpdBaW-Iv8Sw) | |
## 更新日志: | |
* 这是 GitHub Action 自动化部署,更新日志应该很快会手动更新 | |
## 文件校验 | |
| 文件名 | SHA256 | | |
| :- | :- | | |
| <sub>${{ env.ProjectName }}-${{ steps.tag.outputs.tag }}.7z</sub> | <sub>${{ env.NET_SHA256 }}</sub> | | |
| <sub>${{ env.ProjectName }}-Win64-${{ steps.tag.outputs.tag }}.7z</sub> | <sub>${{ env.NET64_SHA256 }}</sub> | | |
| <sub>${{ env.ProjectName }}-Win32-${{ steps.tag.outputs.tag }}.7z</sub> | <sub>${{ env.NET86_SHA256 }}</sub> | |