-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8268de3
commit 12fd3dc
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: NuGet Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' # Specify the tag pattern, e.g., 'v1.0.0' | ||
jobs: | ||
deploy: | ||
name: Deploy | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: | | ||
7.0.x | ||
- uses: actions/cache@v2 | ||
id: cacheStep | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-nuget- | ||
- name: Set VERSION variable from tag | ||
run: | | ||
$VERSION=$Env:GITHUB_REF_NAME.TrimStart("v") | ||
echo "VERSION=$VERSION" >> $Env:GITHUB_ENV | ||
- name: Restore dependencies | ||
run: dotnet restore | ||
- name: Setup NuGet.exe for use with actions | ||
uses: NuGet/setup-nuget@v1.0.5 | ||
- name: Restore NuGet | ||
if: steps.cacheStep.outputs.cache-hit != 'true' | ||
run: nuget restore ReQueue.sln | ||
- name: Build | ||
run: dotnet build ReQueue/ReQueue.csproj --no-restore --configuration Release /p:Version=$Env:VERSION /p:AssemblyVersion=$Env:VERSION | ||
- name: Publish NuGet package | ||
run: dotnet nuget push **/*.nupkg --source https://api.nuget.org/v3/index.json --api-key $Env:NUGET_API_KEY | ||
env: | ||
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} |