Skip to content

Fixed dotnet push

Fixed dotnet push #10

Workflow file for this run

# Builds the library and packs it as NuGet package
name: Build Keycloak.NET
on:
push:
branches: [ "main", "feature/major-upgrade" ]
pull_request:
branches: [ "main" ]
jobs:
Publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Install gitversion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
- name: Calculate version
id: gitversion
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
configFilePath: .github/GitVersion.yml
- name: Save version to file
run: echo "${{ steps.gitversion.outputs.semVer }}" > version
- name: Upload version
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v2
with:
name: Keycloak.NET
path: version
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -p:Version=${{ steps.gitversion.outputs.informationalVersion }} -p:FileVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} -p:AssemblyVersion=${{ steps.gitversion.outputs.assemblySemVer }} --no-restore -c Release
# Tests disabled as they need to be fixed first
# - name: Test
# run: dotnet test --no-build --verbosity normal
- name: Authenticate against Repository
run: dotnet nuget add source --username Skyppid --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name GitHub "https://nuget.pkg.github.com/CarbonFreed-AI/index.json"
- name: Generate package
run: dotnet pack src/Keycloak.Net.Core/Keycloak.Net.Core.csproj -p:PackageVersion="${{ steps.gitversion.outputs.semVer }}" --source "GitHub" --no-restore --no-build --include-symbols --include-source
- name: Upload NuGet package
run: dotnet nuget push src/Keycloak.Net.Core/bin/Release/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "GitHub"