Skip to content

Changed tag extraction #4

Changed tag extraction

Changed tag extraction #4

Workflow file for this run

name: Build and Publish Steamworks.NET NuGet Package
on:
push:
tags:
- '*'
jobs:
build-and-publish:
name: Build and Publish NuGet Package
runs-on: windows-latest
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Setup .NET environment
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.x'
# Setup NuGet client
- name: Setup NuGet client
run: |
choco install nuget -y
nuget update -self
# Extract the version from the tag
- name: Extract tag name
id: tag
uses: actions/github-script@0.2.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
return context.payload.ref.replace(/\/refs\/tags\//, '');
# Build and Package binaries
- name: Build and Package binaries
run: |
dotnet build -t:BatchBuild Standalone/Steamworks.NET.Standard.sln /p:Version=${{ steps.tag.outputs.result }}
nuget pack Standalone/Steamworks.NET.nuspec -OutputDirectory bin\ -Version ${{ steps.tag.outputs.result }}
# Publish the NuGet package
- name: Publish to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
nuget push bin\*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey $NUGET_API_KEY