chore: update actions versions #32
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
name: Lidgren.Network/main | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
LIDGREN_VERSION: '2.0.0.${{ github.run_number }}' | |
ARTIFACT_NAME: 'Lidgren.Network.2.0.0.${{ github.run_number }}' | |
outputs: | |
artifact_name: '${{ env.ARTIFACT_NAME }}' | |
nupkg_base_name: 'AscensionGameDev.Lidgren.Network.${{ env.LIDGREN_VERSION }}-beta' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- id: build_debug | |
name: Build (Debug) | |
run: dotnet build --no-restore -c Debug -p:VersionPrefix=$LIDGREN_VERSION -p:VersionSuffix=beta-debug | |
- id: build_release | |
name: Build (Release) | |
run: dotnet build --no-restore -c Release -p:VersionPrefix=$LIDGREN_VERSION -p:VersionSuffix=beta | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: '${{ env.ARTIFACT_NAME }}' | |
path: 'Lidgren.Network/bin/*' | |
if-no-files-found: error | |
retention-days: 1 | |
test: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Tests (main) | |
run: dotnet test --verbosity normal | |
publish: | |
runs-on: ubuntu-latest | |
needs: [build, test] | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: '${{ needs.build.outputs.artifact_name }}' | |
- name: Publish Debug nupkg | |
run: dotnet nuget push 'Debug/${{ needs.build.outputs.nupkg_base_name }}-debug.nupkg' --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.LIDGREN_NUGET_API_KEY }} | |
- name: Publish Release nupkg | |
run: dotnet nuget push 'Release/${{ needs.build.outputs.nupkg_base_name }}.nupkg' --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.LIDGREN_NUGET_API_KEY }} |