Skip to content

Commit

Permalink
pushing nuget package
Browse files Browse the repository at this point in the history
  • Loading branch information
cmendible committed Mar 29, 2024
1 parent 259a987 commit 48796c4
Showing 1 changed file with 39 additions and 4 deletions.
43 changes: 39 additions & 4 deletions .github/workflows/netDumbster.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
name: dotnetcore
on:
workflow_dispatch:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main

permissions: read-all

jobs:
build:
name: Build
Expand All @@ -10,16 +20,41 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out code
uses: actions/checkout@v1
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

- name: Setup MinVer
run: |
dotnet tool install --global minver-cli --version 4.2.0
- name: Calculate Version
run: |
echo "MINVERVERSIONOVERRIDE=$($HOME/.dotnet/tools/minver -t v. -m 0.1 -d preview)" >> $GITHUB_ENV
if: matrix.os != 'windows-latest'

- name: Calculate Version Windows
run: |
echo "MINVERVERSIONOVERRIDE=$(minver -t v. -m 0.1 -d preview)" >> $env:GITHUB_ENV
if: matrix.os == 'windows-latest'

- name: Build
run: dotnet build
run: dotnet build -c Release

- name: Test
run: dotnet test
run: dotnet test -c Release --no-build

- name: Pack nugets
run: dotnet pack -c Release --no-build --output .
if: matrix.os == 'linux-latest' && github.event_name != 'pull_request' && startswith(github.ref, 'refs/tags/v')

- name: Push to NuGet
run: dotnet nuget push "*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
if: matrix.os == 'linux-latest' && github.event_name != 'pull_request' && startswith(github.ref, 'refs/tags/v')

0 comments on commit 48796c4

Please sign in to comment.