fix #33
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: 发布 | |
on: | |
push: | |
branches: [ "master"] | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
runtimeIdentifier: [ win-x64, linux-x64] | |
name: 构建插件 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: 初始化.NET 8 | |
uses: actions/setup-dotnet@v4 | |
env: | |
DOTNET_CLI_UI_LANGUAGE: zh-CN | |
with: | |
dotnet-version: 8.0.x | |
- name: 构建插件 | |
run: | | |
dotnet publish Lagrange.XocMat/Lagrange.XocMat.csproj --no-self-contained -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=none -p:RuntimeIdentifier=${{ matrix.runtimeIdentifier }} --framework net8.0 | |
- name: 安装 zip | |
run: sudo apt-get install zip | |
- name: 生成压缩包 | |
run: zip -r -j Lagrange.XocMat_${{ matrix.runtimeIdentifier }}_8.0.zip Lagrange.XocMat/bin/Release/net8.0/${{ matrix.runtimeIdentifier }}/publish/ | |
- name: 上传临时文件 | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Artifacts | |
path: Lagrange.XocMat_${{ matrix.runtimeIdentifier }}_8.0.zip | |
LatestRelease: | |
name: 发布 | |
runs-on: ubuntu-latest | |
needs: Build | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: 更新发布标签 | |
run: | | |
git tag -f V1.0.0.0 | |
git push -f origin V1.0.0.0 | |
- name: 下载临时插文件 | |
uses: actions/download-artifact@v3 | |
with: | |
name: Artifacts | |
path: ./bin | |
- name: 发布Release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: V1.0.0.0 | |
name: "最新版本" | |
body: "" | |
artifacts: | | |
./bin/* | |
allowUpdates: true | |
removeArtifacts: true | |
ClearTempArtifacts: | |
name: 清理临时文件 | |
if: always() | |
runs-on: ubuntu-latest | |
needs: | |
- LatestRelease | |
permissions: | |
actions: write | |
steps: | |
- uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: | | |
Artifacts |