Skip to content

Commit f453759

Browse files
authored
Update nuget-pack-push.yml
1 parent cc1e404 commit f453759

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

.github/workflows/nuget-pack-push.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
release:
55
types:
66
- published
7-
- created
8-
- edited
9-
- prereleased
107

118
env:
129
VERSION: 0.0.0
@@ -24,3 +21,27 @@ jobs:
2421
echo "::set-env name=COMMIT::$GITHUB_SHA"
2522
echo "::set-env name=VERSION::${GITHUB_REF/refs\/tags\/v/}"
2623
- run: echo Version $VERSION - Branch $BRANCH - Commit $COMMIT
24+
- uses: actions/checkout@v1
25+
- name: Update tokens in project files
26+
uses: cschleiden/replace-tokens@v1
27+
with:
28+
files: '["*.csproj", "**/*.csproj"]'
29+
- uses: actions/setup-dotnet@v1
30+
with:
31+
dotnet-version: '3.1.100'
32+
- name: Building and verifying library
33+
run: |
34+
dotnet build -c Release /nowarn:CS1591
35+
dotnet test -c Release /nowarn:CS1591
36+
- name: Creating library package
37+
run: dotnet pack src/ -c Release -o ${GITHUB_WORKSPACE} -p:version=$VERSION /nowarn:CS1591
38+
- name: Buidling template package
39+
run: dotnet pack template/ -c Release -o ${GITHUB_WORKSPACE} -p:version=$VERSION -p:PackageVersion=$VERSION
40+
- name: Verifying template
41+
run: |
42+
dotnet new --install ${GITHUB_WORKSPACE}/Razor.Components.Testing.Library.Template.$VERSION.nupkg
43+
dotnet new razortest -o ${GITHUB_WORKSPACE}/Test
44+
dotnet restore ${GITHUB_WORKSPACE}/Test/Test.csproj --source ${GITHUB_WORKSPACE}
45+
dotnet test ${GITHUB_WORKSPACE}/Test
46+
- name: Push packages to NuGet.org
47+
run: dotnet nuget push ${GITHUB_WORKSPACE}/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)