-
-
Notifications
You must be signed in to change notification settings - Fork 42
52 lines (46 loc) · 1.24 KB
/
ci-cd.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
name: CI/CD
on:
push:
workflow_dispatch:
defaults:
run:
shell: pwsh
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- run: build\build.ps1
- uses: actions/upload-artifact@v4
with:
name: nuget
path: artifacts
if-no-files-found: 'error'
release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: windows-latest
steps:
- uses: actions/setup-dotnet@v4
- uses: actions/download-artifact@v4
with:
name: nuget
path: artifacts
- run: dotnet nuget push artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
- uses: actions/github-script@v7
with:
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const tag_name = context.ref.replace(/refs\/tags\//, '');
github.rest.repos.createRelease({
owner,
repo,
tag_name,
name: "Release " + tag_name,
body: "TODO",
draft: true,
});