Skip to content

'Protobuf files change' #467

'Protobuf files change'

'Protobuf files change' #467

Workflow file for this run

name: Upload .NET Package
on: push
env:
# Stop wasting time caching packages
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending usage data to Microsoft
DOTNET_CLI_TELEMETRY_OPTOUT: true
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE: 'skip'
# Project name to pack and publish
PROJECT_NAME: Systemathics.Apis
# Official NuGet Feed settings
# NUGET_FEED: https://api.nuget.org/v3/index.json
# NUGET_KEY: ${{ secrets.NUGET_ORG_API_KEY }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
deploy:
needs: build
# commit contains a tag => deploy
if: startsWith( github.ref, 'refs/tags/v' )
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Set VERSION environment variable
run: |
echo GitHub_ref: $GITHUB_REF
arrTag=(${GITHUB_REF//\// })
VERSION="${arrTag[2]}"
echo Version: $VERSION
VERSION="${VERSION//v}"
echo Clean Version: $VERSION
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Create Release NuGet package
run: dotnet pack -v normal -c Release -p:PackageVersion=${{ env.VERSION }} -o nupkg src/Systemathics.Apis.csproj
- name: Publish the package to nuget.org
run: dotnet nuget push ./nupkg/Systemathics.Apis.${{ env.VERSION }}.nupkg -k $NUGET_ORG_TOKEN -s https://api.nuget.org/v3/index.json
env:
NUGET_ORG_TOKEN: ${{ secrets.NUGET_ORG_TOKEN }}