Skip to content

Publish

Publish #46

Workflow file for this run

name: Publish
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.2
with:
path: ${{ github.event.repository.name }}
- name: Checkout `unmanaged`
uses: actions/checkout@v4.1.2
with:
repository: simulation-tree/unmanaged
token: ${{ secrets.PAT }}
path: unmanaged
- name: Checkout `simulation`
uses: actions/checkout@v4.1.2
with:
repository: simulation-tree/simulation
token: ${{ secrets.PAT }}
path: simulation
- name: Checkout `collections`
uses: actions/checkout@v4.1.2
with:
repository: simulation-tree/collections
token: ${{ secrets.PAT }}
path: collections
- name: Checkout `shaders`
uses: actions/checkout@v4.1.2
with:
repository: simulation-tree/shaders
token: ${{ secrets.PAT }}
path: shaders
- name: Checkout `data`
uses: actions/checkout@v4.1.2
with:
repository: simulation-tree/data
token: ${{ secrets.PAT }}
path: data
- name: Checkout `data-systems`
uses: actions/checkout@v4.1.2
with:
repository: simulation-tree/data-systems
token: ${{ secrets.PAT }}
path: data-systems
- name: Checkout `worlds`
uses: actions/checkout@v4.1.2
with:
repository: simulation-tree/worlds
token: ${{ secrets.PAT }}
path: worlds
- name: Checkout `types`
uses: actions/checkout@v4.1.2
with:
repository: simulation-tree/types
token: ${{ secrets.PAT }}
path: types
- name: Setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
10.0.x
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Build `Shaders.Systems`
run: dotnet build "${{ github.event.repository.name }}/source" -c Debug /p:Version=${VERSION}
- name: Build `Shaders.Systems`
run: dotnet build "${{ github.event.repository.name }}/source" -c Release /p:Version=${VERSION}
- name: Build `Shaders.Systems.Tests`
run: dotnet build "${{ github.event.repository.name }}/tests" -c Debug /p:Version=${VERSION}
- name: Build `Shaders.Systems.Tests`
run: dotnet build "${{ github.event.repository.name }}/tests" -c Release /p:Version=${VERSION}
- name: Test
run: dotnet test "${{ github.event.repository.name }}/tests" -c Release --logger "trx" --framework net10.0
- name: Pack `Shaders.Systems`
run: dotnet pack "${{ github.event.repository.name }}/source" /p:Version=${VERSION} --no-build --output .
- name: Add NuGet Source
run: dotnet nuget add source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --name github --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text
- name: Publish `Shaders.Systems`
run: dotnet nuget push Shaders.Systems.${VERSION}.nupkg --source github --api-key ${NUGET_TOKEN}
env:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}