Skip to content

Merge pull request #26 from AElfProject/release/1.0.0 #8

Merge pull request #26 from AElfProject/release/1.0.0

Merge pull request #26 from AElfProject/release/1.0.0 #8

Workflow file for this run

name: Publish NuGet Package
on:
push:
tags:
- "v*.*.*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Get the version from git tags
id: get_version
run: |
TAG=$(git describe --tags --abbrev=0)
VERSION=${TAG#v}
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build the project
run: dotnet build --configuration Release --no-restore
- name: Pack the NuGet package
run: dotnet pack --configuration Release --no-build --output ./nupkg -p:PackageVersion=${{ env.VERSION }}
- name: Publish the NuGet package
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ./nupkg/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json