-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (36 loc) · 1.26 KB
/
build_publish.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
name: Build & Publish
on:
push:
workflow_dispatch:
jobs:
workflow:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ChefKeys
path: Output/Release/
# - name: publish to nuget
# if: ${{ github.ref == 'refs/heads/main' }}
# run: nuget push output\release\*.nupkg -source 'https://api.nuget.org/v3/index.json' -apikey ${{secrets.publish}}
- name: get version
if: ${{ github.ref == 'refs/heads/main' }}
run: |
$version = [system.diagnostics.fileversioninfo]::getversioninfo("output\release\chefkeys.dll").productversion
echo "release_version=$version" | out-file -filepath $env:github_env -encoding utf-8 -append
- name: publish to github releases
if: ${{ github.ref == 'refs/heads/main' }}
uses: softprops/action-gh-release@v1
with:
files: "output\\release\\*.nupkg"
tag_name: "v${{ env.release_version }}"