Update adoscope-nuget-build.yaml #29
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: adoscope-nuget-build | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setting up build version | |
run: echo "BuildVersion=${{ vars.MAJOR }}.${{ vars.MINOR }}.${{ secrets.REVISION }}-alpha" >> $GITHUB_ENV | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
working-directory: . | |
run: dotnet restore | |
- name: Build | |
working-directory: . | |
run: dotnet build --no-restore --configuration Release | |
- name: Show current directory and list files | |
working-directory: ./Promethix.Framework.Ado | |
run: | | |
echo "Current Directory: $(pwd)" | |
ls ./bin/Release | |
- name: Upload Nuget Package Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Promethix.Framework.Ado.Nuget | |
if-no-files-found: error | |
retention-days: 7 | |
path: ./bin/Release/*.nupkg | |
versioning: | |
name: Update Version - Revision | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- uses: action-pack/set-secret@v1 | |
with: | |
name: 'REVISION' | |
value: $((${{ secrets.REVISION }}+1)) | |
token: ${{ secrets.REPO_ACCESS_TOKEN }} | |
test: | |
name: Run Tests | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Restore NuGet packages | |
working-directory: ./Promethix.Framework.Ado.Tests | |
run: dotnet restore | |
- name: Run Tests | |
working-directory: ./Promethix.Framework.Ado.Tests | |
run: dotnet test --no-restore --verbosity normal | |
publish: | |
name: Publish Promethix.Framework.Ado | |
needs: | |
- build | |
- test | |
- versioning | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Promethix.Framework.Ado.Nuget | |
path: . | |
- name: Show current directory and list files | |
working-directory: ./Promethix.Framework.Ado | |
run: | | |
echo "Current Directory: $(pwd)" | |
ls . | |
- name: Publish Promethix.Framework.Ado | |
working-directory: . | |
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} |