-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (30 loc) · 1.09 KB
/
nuget-push.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
30
31
32
33
34
35
36
37
38
name: Build and Push Nuget Package
on:
workflow_dispatch:
inputs:
tag:
description: Release version to publish (e.g. 1.0.0)
required: true
release:
types: [released]
permissions:
contents: read
packages: write
jobs:
build:
name: Build + Push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set VERSION variable from tag (Dispatch)
if: ${{ github.event_name == 'workflow_dispatch' }}
run: echo "VERSION=${{ inputs.tag }}" >> $GITHUB_ENV
- name: Set VERSION variable from release (Release)
if: ${{ github.event_name == 'release' }}
run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Build
run: dotnet build --configuration Release /p:Version=${VERSION} ./src/Flipt\.Grpc/flipt-grpc.csproj
- name: Pack
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output . ./src/Flipt\.Grpc/flipt-grpc.csproj
- name: Push
run: dotnet nuget push Flipt.gRPC.${VERSION}.nupkg --api-key "${{ secrets.NUGET_API_TOKEN }}"