-
Notifications
You must be signed in to change notification settings - Fork 40
37 lines (30 loc) · 1.13 KB
/
release.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
name: Publish NuGet Packages
on:
release:
types: [published]
permissions:
packages: write
contents: read
jobs:
build:
runs-on: windows-latest
defaults:
run:
working-directory: .
steps:
- name: Download NuGet Packages from Release
run: |
Write-Host "GITHUB_REF: '$($env:GITHUB_REF)'"
$prefix = "refs/tags/"
$name = $($env:GITHUB_REF).Substring($prefix.Length)
Write-Host "name: '$name'"
gh release download $name --repo siemens/sourcegrid --pattern '*.nupkg' --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to github packages
run: |
dotnet nuget add source --username ${{ secrets.USERNAME }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/SIEMENS/index.json"
dotnet nuget push "*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source github
env:
USERNAME: ${{ secrets.USERNAME }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}