Skip to content

update github action to run on correct branch and dotnet version #1

update github action to run on correct branch and dotnet version

update github action to run on correct branch and dotnet version #1

Workflow file for this run

name: nuget
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@main
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0'
- run: dotnet build -c release
# - name: dotnet test
# run: dotnet test -c release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
# env:
# TOKEN: ${{secrets.AZURE_DEVOPS_TOKEN}}
# - uses: codecov/codecov-action@v1
pack:
needs: build
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0'
source-url: https://nuget.pkg.github.com/azure-devops-compliance/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.TOKEN}}
- name: dotnet pack
run: |
export VERSION=$(git rev-list --count HEAD)
dotnet pack -c release -o out -p:PackageVersion=1.0.0.$VERSION
- name: dotnet nuget push
run: dotnet nuget push ./out/*.nupkg --skip-duplicate --no-symbols true --api-key $key
env:
key: ${{secrets.TOKEN}}