Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
BattlefieldDuck committed Jan 18, 2024
1 parent 9a0948c commit 7cfb4c3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 45 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/dotnet-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
29 changes: 14 additions & 15 deletions .github/workflows/dotnet-publish-gpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
27 changes: 13 additions & 14 deletions .github/workflows/dotnet-publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 7cfb4c3

Please sign in to comment.