Skip to content

GitHub Actions

GitHub Actions #12

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Build & Test .NET
on:
push:
branches: [ "master" ]
tags: [ "*" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore ./src/SteamWebAPI2.sln
- name: Build
run: dotnet build ./src/SteamWebAPI2.sln --no-restore
- name: Pack
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
run: dotnet pack ./src/SteamWebAPI2/SteamWebAPI2.csproj -c Release --no-build --output .
- name: Publish
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
run: dotnet nuget push "*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json -n --skip-duplicate