name: Publish to GitHub Packages
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Build solution
run: dotnet build Kayki.StringUtils.sln --configuration Release
- name: Run tests
run: dotnet test Kayki.StringUtilsTests/Kayki.StringUtilsTests.csproj --configuration Release
- name: Build package
run: |
cd Kayki.StringUtils
dotnet build -c Release -o out
- name: Publish to GitHub Packages
run: |
cd Kayki.StringUtils/out
dotnet nuget push *.nupkg --api-key ${{ secrets.PKG_TOKEN }} --source https://nuget.pkg.github.com/kaykiletieri/index.json --skip-duplicate
- name: Publish to NuGet.org
run: |
cd Kayki.StringUtils/out
dotnet nuget push *.nupkg --api-key ${{ secrets.PKG_NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json --skip-duplicate
name: Publish to GitHub Packages
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Build solution
run: dotnet build Kayki.StringUtils.sln --configuration Release
- name: Run tests
run: dotnet test Kayki.StringUtilsTests/Kayki.StringUtilsTests.csproj --configuration Release
- name: Build package
run: |
cd Kayki.StringUtils
dotnet build -c Release -o out
- name: Publish to GitHub Packages
run: |
cd Kayki.StringUtils/out
dotnet nuget push *.nupkg --api-key ${{ secrets.PKG_TOKEN }} --source https://nuget.pkg.github.com/kaykiletieri/index.json --skip-duplicate
- name: Publish to NuGet.org
run: |
cd Kayki.StringUtils/out
dotnet nuget push *.nupkg --api-key ${{ secrets.PKG_NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json --skip-duplicate