-
Notifications
You must be signed in to change notification settings - Fork 5
30 lines (27 loc) · 1.06 KB
/
dotnet-sdk-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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@v3
with:
dotnet-version: 6.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}}