@@ -6,8 +6,9 @@ name: build and release
6
6
on :
7
7
push :
8
8
branches : [ "main" ]
9
- pull_request :
10
- branches : [ "main" ]
9
+ tags :
10
+ - ' v*'
11
+
11
12
12
13
jobs :
13
14
build :
@@ -25,34 +26,17 @@ jobs:
25
26
run : dotnet build --no-restore --configuration Release -o release_package
26
27
- name : Test
27
28
run : dotnet test --no-build --verbosity normal
28
- - name : Package as zip
29
+ - name : Pack to zip
29
30
run : |
30
- compress-archive -Path release_package\* -DestinationPath rmdup_${{github.sha}}.zip -CompressionLevel Fastest
31
- - name : Upload artifact
32
- uses : actions/upload-artifact@v4
33
- with :
34
- name : rmdup_${{github.sha}}.zip
35
- path : rmdup_${{github.sha}}.zip
36
-
37
-
31
+ compress-archive -Path release_package\* -DestinationPath rmdup.zip -CompressionLevel Fastest
38
32
- name : release to github
39
33
id : create_release
34
+ uses : softprops/action-gh-release@v2
40
35
if : startsWith(github.ref,'refs/tags/')
41
- uses : actions/create-release@v1
42
- env :
43
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
44
36
with :
45
- tag_name : ${{ github.sha }}
46
- release_name : ${{ github.sha }}
37
+ files : rmdup.zip
38
+ name : release ${{ github.sha}}
47
39
draft : true
48
- prerelease : false
49
-
50
- - name : publish to github
51
- uses : actions/upload-release-asset@v1
52
- env :
53
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
54
- with :
55
- upload_url : ${{ steps.create_release.outputs.upload_url }}
56
- asset_path : rmdup_${{github.sha}}.zip
57
- asset_name : rmdup_${{github.sha}}.zip
58
- asset_content_type : application/zip
40
+
41
+
42
+
0 commit comments