Skip to content

累积策略更新并新增发布不附带框架的软件包 (#26) #33

累积策略更新并新增发布不附带框架的软件包 (#26)

累积策略更新并新增发布不附带框架的软件包 (#26) #33

Workflow file for this run

name: Test Publisher
on:
push:
branches:
- master
jobs:
publish:
runs-on: windows-latest
strategy:
matrix:
node-version: [ 20.x ]
dotnet-version: [ 8.0.x ]
env:
CONFIG: Release
steps:
- name: 检出代码
uses: actions/checkout@v4
- 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: 修改版本号
run: |
node .github/workflows/edit_version.mjs
- name: 克隆完整仓库
run: |
git fetch --unshallow
- name: 优化 Gitee 连接
run: |
echo 182.255.33.134 gitee.com >> C:\Windows\System32\drivers\etc\hosts
ipconfig /flushdns
- name: 同步分支到 Gitee
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 3
command: |
git fetch --unshallow
git push -f "https://NXY666:$env:[email protected]/NXY666/EdgePolicyManager.git"
env:
GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }}
- name: 安装 .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
cache: true
- name: 发布软件包
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }}
run: |
npm i -g @actions/github @octokit/rest
npm link @actions/github @octokit/rest
node .github/workflows/create_release.mjs