Skip to content

test

test #20

Workflow file for this run

name: release-job
on:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c release
- name: Publish
run: dotnet publish -c Release -r win-x64 -p:PublishReadyToRun=false --self-contained false
- name: Get version
uses: olegtarasov/[email protected]
id: tagName
- name: Create zip
shell: pwsh
# 配置【编译后的文件地址】
run: Compress-Archive -Path ${{github.workspace}}\src\bin\Release\net7.0-windows\win-x64\publish\* -DestinationPath ${{github.workspace}}\src\bin\Release\ComputerLock_${{ steps.tagName.outputs.tag }}_win_x64.zip
- name: Release
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
# 配置【README地址】
body: |
Release为自动生成,具体内容请查看提交日志,或直接查看[README](https://github.com/JiuLing-zhang/ComputerLock#readme)
# 配置【zip文件地址】
files: ${{github.workspace}}\src\bin\Release\ComputerLock_${{ steps.tagName.outputs.tag }}_win_x64.zip