Merge pull request #225 from Color-Chan/dev #87
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish nuget packages | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-alpha" | |
- "v[0-9]+.[0-9]+.[0-9]+-beta" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Set VERSION variable from tag | |
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV | |
- name: Build Color-Chan.Discord | |
run: dotnet build --configuration Release /p:Version=${VERSION} | |
- name: Run unit tests | |
run: dotnet test --configuration Release /p:Version=${VERSION} --no-build | |
- name: Pack Color-Chan.Discord | |
run: dotnet pack ./src/Color-Chan.Discord --configuration Release /p:Version=${VERSION} --no-build --output . | |
- name: Push Color-Chan.Discord nuget.org | |
run: dotnet nuget push Color-Chan.Discord.${VERSION}.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
- name: Pack Color-Chan.Discord.Rest | |
run: dotnet pack ./src/Color-Chan.Discord.Rest --configuration Release /p:Version=${VERSION} --no-build --output . | |
- name: Push Color-Chan.Discord.Rest nuget.org | |
run: dotnet nuget push Color-Chan.Discord.Rest.${VERSION}.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
- name: Pack Color-Chan.Discord.Core | |
run: dotnet pack ./src/Color-Chan.Discord.Core --configuration Release /p:Version=${VERSION} --no-build --output . | |
- name: Push Color-Chan.Discord.Core nuget.org | |
run: dotnet nuget push Color-Chan.Discord.Core.${VERSION}.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
- name: Pack Color-Chan.Discord.Commands | |
run: dotnet pack ./src/Color-Chan.Discord.Commands --configuration Release /p:Version=${VERSION} --no-build --output . | |
- name: Push Color-Chan.Discord.Commands nuget.org | |
run: dotnet nuget push Color-Chan.Discord.Commands.${VERSION}.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
- name: Pack Color-Chan.Discord.Caching | |
run: dotnet pack ./src/Color-Chan.Discord.Caching --configuration Release /p:Version=${VERSION} --no-build --output . | |
- name: Push Color-Chan.Discord.Caching nuget.org | |
run: dotnet nuget push Color-Chan.Discord.Caching.${VERSION}.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json --skip-duplicate |