-
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.
This patch adds GitHub Actions workflow to release and publish NuGet package. Signed-off-by: Taku Izumi <admin@orz-style.com>
- Loading branch information
Showing
1 changed file
with
43 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,43 @@ | ||
name: Release-and-Publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
release: | ||
name: release-build | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout git repository | ||
# https://github.com/actions/checkout | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
# Set up dotnet CLI | ||
# https://github.com/actions/setup-dotnet | ||
- name: Setup .NET CLI | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 8.x | ||
|
||
# Build NuGet package for template | ||
- name: Build NuGet package | ||
run: dotnet pack | ||
|
||
# Zip artifacts | ||
- name: Zip artifacts | ||
run: | | ||
zip -j Kgh02017.Templates.editorconfig-${{github.ref_name}}.zip ./bin/Release/*.nupkg | ||
# Upload release Assets | ||
# https://github.com/AButler/upload-release-assets | ||
- uses: AButler/upload-release-assets@v3.0 | ||
with: | ||
files: Kgh02017.Templates.editorconfig-${{github.ref_name}}.zip | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
release-tag: ${{github.ref_name}} | ||
|
||
# Publish to NuGet.org | ||
- run: | | ||
dotnet nuget push ./bin/Release/*.nupkg -n true -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json |