Setup a documentation site #13
Workflow file for this run
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
# 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: .NET Publish (GitHub Packages) | |
on: | |
pull_request: | |
branches: ["main"] | |
env: | |
DOTNET_VERSION: 8.0.x | |
NUGET_VERSION: 1.0.4 | |
jobs: | |
publish-github-packages: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Restore dependencies | |
run: dotnet restore | |
working-directory: src | |
- name: Build release packages | |
run: dotnet build --no-restore -c Release | |
working-directory: src | |
- name: Publish NuGet package CSnakes | |
run: dotnet pack src/CSnakes --no-build -c Release -o ./nuget -p:PackageVersion='${{ env.NUGET_VERSION }}-alpha.${{ github.run_number }}' | |
- name: Publish NuGet package CSnakes.Runtime | |
run: dotnet pack src/CSnakes.Runtime --no-build -c Release -o ./nuget -p:PackageVersion='${{ env.NUGET_VERSION }}-alpha.${{ github.run_number }}' | |
- name: Publish NuGet packages as artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nuget-packages | |
path: ./nuget | |
- name: Publish to GitHub packages | |
run: dotnet nuget push ./nuget/*.nupkg --source "https://nuget.pkg.github.com/tonybaloney/index.json" --api-key ${{ secrets.GITHUB_TOKEN }} |