From 7cfb4c36bcba4a6d2dda5dc2431dcca7e113ee27 Mon Sep 17 00:00:00 2001 From: Battlefield Duck Date: Fri, 19 Jan 2024 06:14:08 +0800 Subject: [PATCH] Update workflows --- .github/workflows/dotnet-package.yml | 27 ++++++++------------ .github/workflows/dotnet-publish-gpr.yml | 29 +++++++++++----------- .github/workflows/dotnet-publish-nuget.yml | 27 ++++++++++---------- 3 files changed, 38 insertions(+), 45 deletions(-) diff --git a/.github/workflows/dotnet-package.yml b/.github/workflows/dotnet-package.yml index fc799a6..7a624a1 100644 --- a/.github/workflows/dotnet-package.yml +++ b/.github/workflows/dotnet-package.yml @@ -2,28 +2,23 @@ name: Dotnet Package on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] jobs: build: - runs-on: ubuntu-latest - strategy: - matrix: - dotnet: [ '6', '7', '8' ] - name: Dotnet ${{ matrix.dotnet }} steps: - - uses: actions/checkout@v4 - - name: Setup dotnet - uses: actions/setup-dotnet@v3 - with: - dotnet-version: ${{ matrix.dotnet }} - - name: Install dependencies - run: dotnet restore OpenGSQ - - name: Build - run: dotnet build OpenGSQ --no-restore + - uses: actions/checkout@v4 + - name: Setup .NET 8 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8 + - name: Install dependencies + run: dotnet restore OpenGSQ + - name: Build + run: dotnet build OpenGSQ --no-restore # - name: Test # run: dotnet test OpenGSQ --no-build --verbosity normal diff --git a/.github/workflows/dotnet-publish-gpr.yml b/.github/workflows/dotnet-publish-gpr.yml index 8c356a1..92c57e5 100644 --- a/.github/workflows/dotnet-publish-gpr.yml +++ b/.github/workflows/dotnet-publish-gpr.yml @@ -6,21 +6,20 @@ on: jobs: deploy: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Setup .NET 7 - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7 - source-url: https://nuget.pkg.github.com/OpenGSQ/index.json - env: - NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Build - run: dotnet build OpenGSQ -c Release - - name: Create the package - run: dotnet pack OpenGSQ -c Release - - name: Publish the package to GPR - run: dotnet nuget push OpenGSQ/bin/Release/*.nupkg + - uses: actions/checkout@v4 + - name: Setup .NET 8 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8 + source-url: https://nuget.pkg.github.com/OpenGSQ/index.json + env: + NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Build + run: dotnet build OpenGSQ -c Release + - name: Create the package + run: dotnet pack OpenGSQ -c Release + - name: Publish the package to GPR + run: dotnet nuget push OpenGSQ/bin/Release/*.nupkg diff --git a/.github/workflows/dotnet-publish-nuget.yml b/.github/workflows/dotnet-publish-nuget.yml index 8204983..89d890d 100644 --- a/.github/workflows/dotnet-publish-nuget.yml +++ b/.github/workflows/dotnet-publish-nuget.yml @@ -6,20 +6,19 @@ on: jobs: deploy: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Setup .NET 7 - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7 - - name: Build - run: dotnet build OpenGSQ -c Release - - name: Create the package - run: dotnet pack OpenGSQ -c Release - - name: Publish the package to nuget.org - run: dotnet nuget push OpenGSQ/bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json - env: - NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }} + - uses: actions/checkout@v4 + - name: Setup .NET 8 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8 + - name: Build + run: dotnet build OpenGSQ -c Release + - name: Create the package + run: dotnet pack OpenGSQ -c Release + - name: Publish the package to nuget.org + run: dotnet nuget push OpenGSQ/bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json + env: + NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }}