累积策略更新并修复UI相关问题 (#14) #22
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: Publisher | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
publish: | |
runs-on: windows-latest | |
steps: | |
- name: 检出代码 | |
uses: actions/checkout@v2 | |
- name: 获取发布信息 | |
run: | | |
echo "PUBLISH_VERSION=$(Get-Date -Format 'yyyy.MM.dd.HHmm')" >> $env:GITHUB_ENV | |
echo "PUBLISH_DATETIME=$(Get-Date -Format 'yyyy.MM.dd HH:mm:ss')" >> $env:GITHUB_ENV | |
echo "EDGE_POLICY_VERSION=$(Get-Content ./StaticModels/Policy/SUPPORT_VERSION)" >> $env:GITHUB_ENV | |
- name: 获取提交信息 | |
run: | | |
echo "COMMIT_TITLE=$(git log -1 --pretty=format:'%s')" >> $GITHUB_ENV | |
commit_body=$(git log -1 --pretty=format:"%b" | sed -E 's/^([^ ]+) (.+)$/* `\1` \2/') | |
{ | |
echo 'COMMIT_BODY<<EOF' | |
echo "$commit_body" | |
echo EOF | |
} >> "$GITHUB_ENV" | |
shell: bash | |
- name: 创建 Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ env.PUBLISH_VERSION }} | |
release_name: Release ${{ env.PUBLISH_VERSION }} | |
body: | | |
## 更新日志 | |
概述:**${{ env.COMMIT_TITLE }}** | |
<details> | |
${{ env.COMMIT_BODY }} | |
</details> | |
<hr> | |
> 发布时间:${{ env.PUBLISH_DATETIME }} | |
> 策略版本:${{ env.EDGE_POLICY_VERSION }} | |
draft: false | |
prerelease: false | |
- name: 安装 .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '8.0.x' | |
- name: 生成软件包 | |
run: | | |
dotnet publish -p:Platform=x64 -p:PublishProfile=Properties/PublishProfiles/win-x64.pubxml | |
dotnet publish -p:Platform=x86 -p:PublishProfile=Properties/PublishProfiles/win-x86.pubxml | |
dotnet publish -p:Platform=ARM64 -p:PublishProfile=Properties/PublishProfiles/win-arm64.pubxml | |
- name: 压缩软件包 | |
run: | | |
7z a -tzip -mx=9 Publish-x64.zip ./bin/publish/win-x64/* | |
7z a -t7z -mx=9 Publish-x64.7z ./bin/publish/win-x64/* | |
7z a -tzip -mx=9 Publish-x86.zip ./bin/publish/win-x86/* | |
7z a -t7z -mx=9 Publish-x86.7z ./bin/publish/win-x86/* | |
7z a -tzip -mx=9 Publish-arm64.zip ./bin/publish/win-arm64/* | |
7z a -t7z -mx=9 Publish-arm64.7z ./bin/publish/win-arm64/* | |
- name: 上传软件包(x64-zip) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./Publish-x64.zip | |
asset_name: EdgePolicyManager-Release-${{ env.PUBLISH_VERSION }}-x64.zip | |
asset_content_type: application/zip | |
- name: 上传软件包(x64-7z) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./Publish-x64.7z | |
asset_name: EdgePolicyManager-Release-${{ env.PUBLISH_VERSION }}-x64.7z | |
asset_content_type: application/7z | |
- name: 上传软件包(x86-zip) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./Publish-x86.zip | |
asset_name: EdgePolicyManager-Release-${{ env.PUBLISH_VERSION }}-x86.zip | |
asset_content_type: application/zip | |
- name: 上传软件包(x86-7z) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./Publish-x86.7z | |
asset_name: EdgePolicyManager-Release-${{ env.PUBLISH_VERSION }}-x86.7z | |
asset_content_type: application/7z | |
- name: 上传软件包(arm64-zip) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./Publish-arm64.zip | |
asset_name: EdgePolicyManager-Release-${{ env.PUBLISH_VERSION }}-arm64.zip | |
asset_content_type: application/zip | |
- name: 上传软件包(arm64-7z) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./Publish-arm64.7z | |
asset_name: EdgePolicyManager-Release-${{ env.PUBLISH_VERSION }}-arm64.7z | |
asset_content_type: application/7z |