Skip to content

Workflow file for this run

name: Nuget client Continuous integration
on:
push:
branches:
- 'master'
- 'develop'
- 'netcore'
- 'release/*'
pull_request:
branches:
- '*'
- '!master'
jobs:
build_test_pack:
name: Build, test & pack
runs-on: windows-latest
env:
buildConfiguration: release
versionSuffix: ${{ github.ref == 'refs/heads/develop' && '-inte-' || contains(github.ref,'release/') && '-pre-' || '-ci-' }}${{github.RUN_NUMBER }}
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Set up Node.js ⚙️
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Setup .NET Core @ Latest
uses: actions/setup-dotnet@v1
with:
source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Restore
run: dotnet restore PowerSlice.sln --configfile Nuget.config
- name: Build (Release version)
if: ${{ github.ref == 'refs/heads/master' }}
run: dotnet build --no-restore --configuration $env:buildConfiguration
- name: Build (Pre-Release version)
if: ${{ github.ref != 'refs/heads/master' }}
run: dotnet build --no-restore --configuration $env:buildConfiguration --version-suffix $env:versionSuffix
- name: Test
run: dotnet test --no-build --configuration $env:buildConfiguration
- name: Pack (Release version)
if: ${{ github.ref == 'refs/heads/master' }}
run: |
./build/pack.ps1
- name: Pack (Pre-Release version)
if: ${{ github.ref != 'refs/heads/master' }}
run: |
./build/pack.ps1 -versionSuffix $env:versionSuffix
- name: Publish packages
run: dotnet nuget push artifacts/**/*.nupkg --skip-duplicate -k ${{ secrets.GITHUB_TOKEN }}