-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.74 KB
/
Deploy.yml
File metadata and controls
48 lines (39 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Deploy Windows Forms App
on:
push:
jobs:
build:
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x # 指定 .NET 6 版本
- name: Restore dependencies
run: dotnet restore
- name: Publish Windows Forms App with ClickOnce without version
if: "!startsWith(github.ref, 'refs/tags/')"
run: dotnet publish -c Release -r win-x64 --self-contained false /p:PublishSingleFile=true /p:ClickOnceDeploymentBuild=true /p:PublishProfile="./QuickIPchange/My Project/PublishProfiles/ClickOnceProfile.pubxml"
- name: Get the version Tag
if: startsWith(github.ref, 'refs/tags/')
id: vars
run: echo ${{ github.ref_name }}
- name: Publish Windows Forms App with ClickOnce with version
if: startsWith(github.ref, 'refs/tags/')
run: dotnet publish -c Release -r win-x64 --self-contained false /p:PublishSingleFile=true /p:ClickOnceDeploymentBuild=true /p:PublishProfile="./QuickIPchange/My Project/PublishProfiles/ClickOnceProfile.pubxml" /p:AssemblyVersion=${{ github.ref_name }} /p:Version=${{ github.ref_name }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: clickonce-artifact
path: ./QuickIPchange/bin/Release/net6.0-windows/win-x64/publish/QuickIPchange.exe
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./QuickIPchange/bin/Release/net6.0-windows/win-x64/publish/QuickIPchange.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}