Skip to content

Merge pull request #63 from ewilliams0305/development #4

Merge pull request #63 from ewilliams0305/development

Merge pull request #63 from ewilliams0305/development #4

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Deploy NUGET 🚀👩‍🚀
#on:
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
#jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Setup .NET
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: 6.x
# - name: Restore dependencies
# run: dotnet restore source/ClientBuilder.sln
# - name: Build Solution
# run: dotnet build source/ClientBuilder.sln --no-restore
# - name: Run Unit Tests
# run: dotnet test tests/Kangaroo.UnitTests/Kangaroo.UnitTests.csproj --no-build --verbosity normal
# - name: Run Integration Tests
# run: dotnet test tests/Kangaroo.IntegrationTests/Kangaroo.IntegrationTests.csproj --no-build --verbosity normal
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Verify commit exists in origin/main
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/main
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Build
run: dotnet build source/Kangaroo.csproj --configuration Release /p:Version=${VERSION}
- name: Test
run: dotnet test source/Kangaroo.csproj --configuration Release /p:Version=${VERSION} --no-build
- name: Pack
run: dotnet pack source/Kangaroo.csproj --configuration Release /p:Version=${VERSION} --no-build --output ./artifacts
- name: Push
run: dotnet nuget push ./artifacts/*{VERSION}.nupkg --source https://nuget.pkg.github.com/acraven/index.json --api-key ${secrets.NUGET_API_KEY}
env:
GITHUB_TOKEN: ${{ secrets.NUGET_API_KEY }}