Skip to content

Packages updated.

Packages updated. #14

Workflow file for this run

name: .NET
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PACKAGES_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Setup NuGet
uses: NuGet/[email protected]
- name: Authenticate with GitHub Packages
run: |
nuget sources remove -name github || true
nuget sources add -name github -source https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json -username ${GITHUB_REPOSITORY_OWNER} -password ${{ secrets.GITHUB_TOKEN }}
# Build and publish BiUM.Core
- name: Build BiUM.Core
run: dotnet build ./src/BiUM.Core/BiUM.Core.csproj -c Release
- name: Pack BiUM.Core
run: dotnet pack ./src/BiUM.Core/BiUM.Core.csproj -c Release -o nupkg
- name: Publish BiUM.Core
run: dotnet nuget push ./src/BiUM.Core/bin/Release/*.nupkg --source "https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json" -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
- name: Clear NuGet cache
run: dotnet nuget locals all --clear
- name: Add or update GitHub Packages source
run: |
dotnet nuget remove source github || true
dotnet nuget add source https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json --name github --username ${GITHUB_REPOSITORY_OWNER} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text
continue-on-error: true
- name: Wait for package propagation
run: sleep 30
# Build and publish BiUM.Infrastructure
- name: Build BiUM.Infrastructure
run: dotnet build ./src/BiUM.Infrastructure/BiUM.Infrastructure.csproj -c Release
- name: Pack BiUM.Infrastructure
run: dotnet pack ./src/BiUM.Infrastructure/BiUM.Infrastructure.csproj -c Release -o nupkg
- name: Publish BiUM.Infrastructure
run: dotnet nuget push ./src/BiUM.Infrastructure/bin/Release/*.nupkg --source "https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json" -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
- name: Clear NuGet cache
run: dotnet nuget locals all --clear
- name: Add or update GitHub Packages source
run: |
dotnet nuget remove source github || true
dotnet nuget add source https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json --name github --username ${GITHUB_REPOSITORY_OWNER} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text
continue-on-error: true
- name: Wait for package propagation
run: sleep 30
# Build and publish BiUM.Specialized
- name: Build BiUM.Specialized
run: dotnet build ./src/BiUM.Specialized/BiUM.Specialized.csproj -c Release
- name: Pack BiUM.Specialized
run: dotnet pack ./src/BiUM.Specialized/BiUM.Specialized.csproj -c Release -o nupkg
- name: Publish BiUM.Specialized
run: dotnet nuget push ./src/BiUM.Specialized/bin/Release/*.nupkg --source "https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json" -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
# Restore dependencies after publishing internal packages
- name: Configure NuGet source
run: |
dotnet nuget remove source github || true
dotnet nuget add source ${{ env.GITHUB_PACKAGES_URL }} --name github --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text
- name: Restore dependencies
run: dotnet restore --source ${{ env.GITHUB_PACKAGES_URL }} --source https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: dotnet build --no-restore -c Debug --source ${{ env.GITHUB_PACKAGES_URL }} --source https://api.nuget.org/v3/index.json
- name: Test
run: dotnet test --no-build --verbosity normal