Release #3
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
name: Release | |
on: | |
create: | |
branches: | |
- 'release/*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.x.x' # You can adjust the version if needed | |
- name: Build | |
run: | | |
version=$(echo "${{ github.ref }}" | sed 's/refs\/heads\/release\///') | |
echo $version | |
dotnet restore | |
dotnet build --configuration Release -p:Version=$version | |
- name: Push | |
run: | | |
packages=$(find . -name '*.nupkg') | |
echo ${{ steps.extract-version.outputs.version }} | |
for package in $packages; do | |
dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY | |
done | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} |