Skip to content

Build and publish the OpenZiti.NET nuget project #56

Build and publish the OpenZiti.NET nuget project

Build and publish the OpenZiti.NET nuget project #56

name: Build and publish the OpenZiti.NET nuget project
on:
workflow_dispatch:
push:
branches:
#- main
- 'release-*'
- 'beta-release-*'
jobs:
build-and-push:
if: "!contains(github.event.head_commit.message, 'ci skip') && ${{ github.actor != 'dependabot[bot]' && github.repository_owner == 'openziti' }}"
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- if: github.event_name == 'push'
run: echo "GIT_BRANCH=$($env:GITHUB_REF.replace('refs/heads/', ''))" >> $env:GITHUB_ENV
- if: github.event_name == 'pull_request'
run: echo "GIT_BRANCH=$env:GITHUB_HEAD_REF" >> $env:GITHUB_ENV
- if: ${{ env.GIT_BRANCH == 'main' }}
name: Publish OpenZiti.NET
run: dotnet build OpenZiti.NET/OpenZiti.NET.csproj /t:NugetPush /p:Configuration=Release /p:NUGET_SOURCE=https://api.nuget.org/v3/index.json /p:API_KEY=${{secrets.NUGET_API_KEY}}