|
| 1 | +# Publishes beta-versions only |
| 2 | +name: Publish Package |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - name: .NET Info |
| 12 | + run: dotnet --info |
| 13 | + - name: Check .NET 8 |
| 14 | + id: check-dotnet8 |
| 15 | + run: | |
| 16 | + DOTNET8_VERSION=$(dotnet --version) |
| 17 | + if [[ "$DOTNET8_VERSION" =~ ^8\.0\.[0-9]+$ ]]; then |
| 18 | + echo "dotnet8_installed=true" >> $GITHUB_ENV |
| 19 | + else |
| 20 | + echo "dotnet8_installed=false" >> $GITHUB_ENV |
| 21 | + fi |
| 22 | + - name: Setup .NET 8 |
| 23 | + if: env.dotnet8_installed == 'false' |
| 24 | + uses: actions/setup-dotnet@v3 |
| 25 | + with: |
| 26 | + dotnet-version: 8.0.x |
| 27 | + - name: .NET Info |
| 28 | + run: dotnet --info |
| 29 | + - name: Checkout |
| 30 | + uses: actions/checkout@v4 |
| 31 | + - name: Restore |
| 32 | + run: dotnet restore ./Ocelot.Administration.IdentityServer4.sln -p:TargetFramework=net8.0 |
| 33 | + - name: Build |
| 34 | + run: dotnet build --no-restore ./Ocelot.Administration.IdentityServer4.sln --framework net8.0 |
| 35 | + - name: Unit Tests |
| 36 | + run: dotnet test --no-restore --no-build ./unit/Ocelot.Administration.IdentityServer4.UnitTests.csproj --collect:"XPlat Code Coverage" --framework net8.0 |
| 37 | + - name: Acceptance Tests |
| 38 | + run: dotnet test --no-restore --no-build ./acceptance/Ocelot.Administration.IdentityServer4.AcceptanceTests.csproj --framework net8.0 |
| 39 | + - name: Report generator |
| 40 | + run: | |
| 41 | + dotnet tool restore |
| 42 | + dotnet tool run reportgenerator |
| 43 | +
|
| 44 | + # build2: |
| 45 | + # runs-on: ubuntu-latest |
| 46 | + # permissions: |
| 47 | + # packages: write |
| 48 | + # contents: read |
| 49 | + # steps: |
| 50 | + # - name: Checkout repository |
| 51 | + # uses: actions/checkout@v4 |
| 52 | + |
| 53 | + # - name: Setup .NET |
| 54 | + # uses: actions/setup-dotnet@v4 |
| 55 | + # with: |
| 56 | + # dotnet-version: | |
| 57 | + # 8.0.x |
| 58 | + # 9.0.x |
| 59 | + |
| 60 | + # - name: .NET Info |
| 61 | + # run: dotnet --info |
| 62 | + |
| 63 | + # - name: Restore dependencies |
| 64 | + # run: dotnet restore ./Ocelot.Administration.IdentityServer4.sln |
| 65 | + |
| 66 | + # - name: Build project |
| 67 | + # run: dotnet build ./src/Ocelot.Testing.csproj --configuration Release --no-restore |
| 68 | + |
| 69 | + # - name: Pack project |
| 70 | + # run: dotnet pack ./src/Ocelot.Testing.csproj --configuration Release --output ./packages |
| 71 | + |
| 72 | + # - name: Publish to GitHub Packages |
| 73 | + # run: dotnet nuget push ./packages/*.nupkg --source "https://nuget.pkg.github.com/ThreeMammals/index.json" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate |
| 74 | + |
| 75 | + # - name: Publish to NuGet |
| 76 | + # run: dotnet nuget push ./packages/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGET_API_KEY_2025 }} --skip-duplicate |
0 commit comments