-
Notifications
You must be signed in to change notification settings - Fork 6
60 lines (51 loc) · 1.66 KB
/
main.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
name: Main
on: [push, pull_request]
defaults:
run:
shell: pwsh
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.100'
- name: Build and NuGet
run: |
dotnet build
dotnet nuget push **/bin/Debug/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
New-Item -ItemType Directory Artifact
Copy-Item **/bin/Debug/net6.0/* Artifact
Copy-Item LICENSE,README.md Artifact
- name: CI Artifact
uses: actions/upload-artifact@v3
with:
name: Plugin
path: |
Artifact
- name: Prepare Release
id: setenvo
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
echo "TAG_NAME=$(git rev-list --count HEAD)" >> $env:GITHUB_OUTPUT
dotnet build /p:GenerateDocumentationFile=true
Copy-Item **/bin/Debug/net6.0/* Artifact
tar cvf Artifact.tar Artifact
Compress-Archive -Path Artifact Artifact.zip
- name: Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
with:
prerelease: true
tag_name: v${{ steps.setenvo.outputs.TAG_NAME }}
target_commitish: ${{ github.sha }}
name: Release v${{ steps.setenvo.outputs.TAG_NAME }}
files: |
Artifact.tar
Artifact.zip