1
+ name : Release_CLI_Stable
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - " *.*.*"
7
+ - " !*.*.*-beta*"
8
+ - " !*.*.*-rc*"
9
+
10
+ jobs :
11
+ publish_cli :
12
+ name : Build and upload cli artifact
13
+ runs-on : ubuntu-latest
14
+ strategy :
15
+ matrix :
16
+ targets :
17
+ [
18
+ " linux-x64" ,
19
+ " osx-x64" ,
20
+ " win-x86" ,
21
+ ]
22
+ steps :
23
+ - name : Checkout
24
+ uses : actions/checkout@v1
25
+ - name : Set up .NET Core
26
+ uses : actions/setup-dotnet@v1
27
+ with :
28
+ dotnet-version : " 5.0.x"
29
+ - name : Publish .NET app
30
+ env :
31
+ RID : ${{ matrix.targets }}
32
+ VERSION : ${{ github.ref_name }}
33
+ run : dotnet publish src/dotnet-cnblogs/dotnet-cnblog.csproj -c Release -r $RID -p:PublishSingleFile=true -p:PublishTrimmed=true -p:DebugType=None -p:DebugSymbols=false -p:EnableCompressionInSingleFile=true --self-contained true --output /home/runner/work/clis/$RID
34
+
35
+ - name : Package assets
36
+ env :
37
+ RID : ${{ matrix.targets }}
38
+ VERSION : ${{ github.ref_name }}
39
+ run : |
40
+ mkdir /home/runner/work/release
41
+ ls /home/runner/work/clis/
42
+ zip -j /home/runner/work/release/dotnet-cnblogs.$VERSION.$RID.zip /home/runner/work/clis/$RID/*
43
+ - name : Upload artifacts
44
+ uses : actions/upload-artifact@v2
45
+ with :
46
+ name : dotnet-cnblogs
47
+ path : /home/runner/work/release
48
+
49
+ publish_windows_x64_and_arm_aot :
50
+ name : Build and upload windows x64 and arm64 aot cli artifact
51
+ runs-on : windows-latest
52
+ strategy :
53
+ matrix :
54
+ targets :
55
+ [
56
+ " win-x64" ,
57
+ " win-arm64"
58
+ ]
59
+ steps :
60
+ - name : Checkout
61
+ uses : actions/checkout@v1
62
+ - name : Setup .NET Core SDK 6.x
63
+ uses : actions/setup-dotnet@v2
64
+ with :
65
+ dotnet-version : 6.x
66
+ - name : Publish .NET app
67
+ env :
68
+ RID : ${{ matrix.targets }}
69
+ VERSION : ${{ github.ref_name }}
70
+ run : dotnet publish src/dotnet-cnblogs/dotnet-cnblog.csproj -c Release -r $($env:RID) -p:UseAot=true -p:DebugType=None -p:DebugSymbols=false --self-contained true --output ../publish/$($env:RID)
71
+
72
+ - name : Package assets
73
+ env :
74
+ RID : ${{ matrix.targets }}
75
+ VERSION : ${{ github.ref_name }}
76
+ run : |
77
+ mkdir ../release
78
+ rm -fo ../publish/$($env:RID)/*.pdb
79
+ ls ../publish/
80
+ Compress-Archive -Path ../publish/$($env:RID)/* -DestinationPath ../release/dotnet-cnblogs.$($env:VERSION).$($env:RID).zip
81
+ - name : Upload artifacts
82
+ uses : actions/upload-artifact@v2
83
+ with :
84
+ name : dotnet-cnblogs
85
+ path : D:/a/dotnet-cnblogs/release
86
+
87
+ release_cli :
88
+ name : Publish release
89
+ needs : ['publish_cli','publish_windows_x64_and_arm_aot']
90
+ runs-on : ubuntu-latest
91
+
92
+ steps :
93
+ - name : Download build artifacts
94
+ uses : actions/download-artifact@v1
95
+ with :
96
+ name : dotnet-cnblogs
97
+ - name : list dotnet-cnblogs
98
+ run : ls dotnet-cnblogs
99
+ - name : Release
100
+ uses : softprops/action-gh-release@v1
101
+ if : startsWith(github.ref, 'refs/tags/')
102
+ with :
103
+ files : dotnet-cnblogs/**
104
+ generate_release_notes : true
0 commit comments