-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (72 loc) · 2.35 KB
/
release.yml
File metadata and controls
90 lines (72 loc) · 2.35 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Release
on:
release:
types: [published]
permissions:
contents: read
packages: write
id-token: write
env:
DOTNET_VERSION: "10.0.x"
NODE_VERSION: "20"
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
- name: Restore dependencies
run: dotnet restore
- name: Build project
run: dotnet build --no-restore --configuration Release
- name: Run unit tests
run: dotnet test --no-build --verbosity normal --configuration Release /p:CollectCoverage=true /p:Threshold=50 /p:ThresholdType=line /p:ThresholdStat=Average /p:CoverletOutput=./TestResults/ /p:ExcludeByAttribute="GeneratedCodeAttribute"
publish-packages:
name: Publish Package to GitHub Packages and NuGet.org
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
source-url: https://nuget.pkg.github.com/bpsLogicBuilder/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: NuGet login
uses: NuGet/login@v1
id: nuget_login
with:
user: ${{ secrets.NUGET_USER }}
- name: Restore dependencies
run: dotnet restore
- name: Build project
run: dotnet build --no-restore --configuration Release
- name: Make script executable
run: chmod +x ./Release_Pack_Push.ps1
shell: bash
- name: Publish Packages
shell: pwsh
run: ./Release_Pack_Push.ps1
env:
REPO: ${{ github.repository }}
REPO_OWNER: ${{ github.repository_owner }}
NUGET_URL: 'https://api.nuget.org/v3/index.json'
GITHUB_NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_API_KEY: ${{ steps.nuget_login.outputs.NUGET_API_KEY }}