Skip to content

Commit

Permalink
ci: release workflow
Browse files Browse the repository at this point in the history
This patch adds GitHub Actions workflow to release and publish
NuGet package.

Signed-off-by: Taku Izumi <admin@orz-style.com>
  • Loading branch information
kgh02017 committed Apr 13, 2024
1 parent 4625c2f commit af2d08e
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/release.yaml
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

0 comments on commit af2d08e

Please sign in to comment.