-
Notifications
You must be signed in to change notification settings - Fork 7
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
DUWENINK
committed
Nov 24, 2024
1 parent
7e35101
commit a3268d6
Showing
5 changed files
with
74 additions
and
5 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,34 @@ | ||
name: NuGet Package Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '9.0.x' | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --configuration Release --no-restore | ||
|
||
- name: Get Version | ||
id: get_version | ||
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | ||
|
||
- name: Pack | ||
run: dotnet pack DUWENINK.Captcha/DUWENINK.Captcha.csproj --configuration Release /p:Version=${{ steps.get_version.outputs.VERSION }} --no-build --output nupkg | ||
|
||
- name: Push to NuGet | ||
run: dotnet nuget push ./nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate |
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,34 @@ | ||
image: mcr.microsoft.com/dotnet/sdk:9.0 | ||
|
||
stages: | ||
- build | ||
- pack | ||
- publish | ||
|
||
variables: | ||
PROJECT_PATH: "DUWENINK.Captcha/DUWENINK.Captcha.csproj" | ||
|
||
build: | ||
stage: build | ||
script: | ||
- dotnet restore | ||
- dotnet build --configuration Release | ||
only: | ||
- tags | ||
|
||
pack: | ||
stage: pack | ||
script: | ||
- dotnet pack $PROJECT_PATH --configuration Release /p:Version=${CI_COMMIT_TAG} --output ./nupkg | ||
artifacts: | ||
paths: | ||
- ./nupkg/*.nupkg | ||
only: | ||
- tags | ||
|
||
publish: | ||
stage: publish | ||
script: | ||
- dotnet nuget push ./nupkg/*.nupkg --source "${NUGET_SOURCE}" --api-key "${NUGET_API_KEY}" --skip-duplicate | ||
only: | ||
- tags |
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
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
Binary file not shown.