v0.2.6 #15
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
name: Nuget Release | |
on: | |
release: | |
types: [created, edited] | |
jobs: | |
run_tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9 | |
- name: Build/Check for compile errors (dotnet build) | |
working-directory: "MaLoIdentModels" | |
run: dotnet build --configuration Release | |
- name: Run Unit Tests (dotnet test) # never ever release with failing tests! | |
working-directory: "MaLoIdentModels" | |
run: dotnet test --configuration Release | |
push_release: | |
needs: run_tests | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: windows-latest | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9 | |
- uses: olegtarasov/[email protected] | |
id: tagTBC | |
with: | |
tagRegex: "v(\\d+\\.\\d+\\.\\d+)" | |
- name: Build/Check for compile errors (dotnet build) | |
working-directory: "MaLoIdentModels" | |
run: dotnet build --configuration Release | |
- name: Create Package MaLoIdentModels (dotnet pack) | |
working-directory: "MaLoIdentModels/MaLoIdentModels" | |
run: dotnet pack MaLoIdentModels.csproj --configuration Release -p:PackageVersion="${{ steps.tagTBC.outputs.tag }}" | |
- name: Setup Nuget.exe | |
uses: warrenbuckley/Setup-Nuget@v1 | |
- name: Nuget push MaLoIdentModels | |
working-directory: "MaLoIdentModels/MaLoIdentModels" | |
# token: https://github.com/Hochfrequenz/MaLoIdentModels/settings/secrets/actions/NUGET_ORG_PUSH_TOKEN | |
# expires 2025-09-27; token is owned by konstantin as of now. | |
env: | |
NUGET_ORG_PUSH_TOKEN: ${{ secrets.NUGET_ORG_PUSH_TOKEN }} | |
run: | | |
dotnet nuget push ./bin/Release/*.nupkg --api-key $NUGET_ORG_PUSH_TOKEN --source https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols |