Skip to content

Package up Prerelease. #2

Package up Prerelease.

Package up Prerelease. #2

name: Package up Prerelease.
on:
workflow_dispatch
# push:
# branches:
# - develop
# - releases/*
jobs:
build:
runs-on: windows-latest
env:
CONFIG: 'Release'
SOLUTION_FILE: './src/UmbNav.sln'
OUT_FOLDER: './build.out/'
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: '5.x'
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Retrieve cache
uses: actions/cache@v3
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-umbcheckout
- name: Determine Version with GitVersion (MSBuild in Proj will do this)
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.15
with:
useConfigFile: true
configFilePath: ./GitVersion.yml
- name: Display GitVersion SemVer
run: |
echo "FullSemVer: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
# ------------------------
# actual builds / packages
# ------------------------
- name: Restore UmbNav.Web
run: dotnet restore ./src/UmbNav.Web/UmbNav.Web.csproj
- name: Restore UmbNav.Core
run: dotnet restore ./src/UmbNav.Core/UmbNav.Core.csproj
- name: Restore UmbNav.Api
run: dotnet restore ./src/UmbNav.Api/UmbNav.Api.csproj
- name: Build UmbNav.Core
run: dotnet pack ./src/UmbNav.Core/UmbNav.Core.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.nuGetVersionV2}}
- name: Build UmbNav.Api
run: dotnet pack ./src/UmbNav.Api/UmbNav.Api.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.nuGetVersionV2}}
- name: Build UmbNav.Web
run: dotnet pack ./src/UmbNav.Web/UmbNav.Web.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.nuGetVersionV2}}
- name: Push to GitHub Nuget Repo
if: ${{ github.event_name != 'pull_request' }}
run: |
dotnet nuget push ./build.out/UmbNav.Web.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/umbhost/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/UmbNav.Core.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/umbhost/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/UmbNav.Api.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/umbhost/index.json --api-key ${{ github.token }}
- name: Push to UmbHost Nuget Repo
if: ${{ github.event_name != 'pull_request' }}
run: |
dotnet nuget push ./build.out/UmbNav.Web.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
dotnet nuget push ./build.out/UmbNav.Core.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
dotnet nuget push ./build.out/UmbNav.Api.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
- name: Create Release
uses: "softprops/action-gh-release@v0.1.15"
with:
name: ${{steps.gitversion.outputs.fullSemVer}}
tag_name: ${{steps.gitversion.outputs.fullSemVer}}
prerelease: true
generate_release_notes: true
files: |
./build.out/UmbNav.Web.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg
./build.out/UmbNav.Core.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg
./build.out/UmbNav.Api.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg