Skip to content

升级版本

升级版本 #62

name: .NET Desktop
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
VERSION: "0.4.5.${{github.run_number}}"
jobs:
build:
runs-on: windows-latest
steps:
- name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: '9.0.x'
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: dotnet restore src/Weather.sln
# Build applications
- name: Build win-x64
run: dotnet publish src\WeatherCalendar\WeatherCalendar.csproj -r win-x64 -p:Configuration=Release -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true --self-contained true -property:Version=${{ env.VERSION }}
- name: Zip win-x64 build
uses: vimtor/action-zip@v1
with:
files: src\WeatherCalendar\bin\Release\net8.0-windows\win-x64\publish\
dest: WeatherCalendar-Windows-x64.zip
- name: Collect win-x64 artifacts
uses: actions/upload-artifact@v4
with:
name: WeatherCalendar-Windows-x64
path: ${{ github.workspace }}\WeatherCalendar-Windows-x64.zip
# Release Management
- name: Delete release drafts
uses: hugo19941994/[email protected]
with:
threshold: 1s
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v1
#if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
tag_name: v${{ env.VERSION }}
generate_release_notes: true
files: |
${{ github.workspace }}\WeatherCalendar-Windows-x64.zip