Skip to content

Updated GitVersion

Updated GitVersion #8

name: Package up Prerelease.
on:
push:
branches:
- develop
jobs:
build:
runs-on: windows-latest
env:
CONFIG: 'Release'
OUT_FOLDER: './build.out/'
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.x"
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: develop
- name: Retrieve cache
uses: actions/cache@v3
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-umbhost-cloudflare-purge
- name: Determine Version with GitVersion (MSBuild in Proj will do this)
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
configFilePath: ./GitVersion.yml
- name: Display GitVersion SemVer
run: |
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
# ------------------------
# actual builds / packages
# ------------------------
- name: Restore UmbHost.Cloudflare.Purge
run: dotnet restore ./UmbHost.Cloudflare.Purge/UmbHost.Cloudflare.Purge.csproj
- name: Build UmbHost.Cloudflare.Purge
run: dotnet pack ./UmbHost.Cloudflare.Purge/UmbHost.Cloudflare.Purge.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}
- name: Push to UmbHost GitHub Nuget Repo
if: ${{ github.event_name != 'pull_request' }}
run: |
dotnet nuget push ./build.out/UmbHost.Cloudflare.Purge.${{steps.gitversion.outputs.fullSemVer}}.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/UmbHost.Cloudflare.Purge.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
- name: Create Release
uses: "softprops/[email protected]"
with:
name: ${{steps.gitversion.outputs.fullSemVer}}
tag_name: ${{steps.gitversion.outputs.fullSemVer}}
prerelease: true
files: |
./build.out/UmbHost.Cloudflare.Purge.${{steps.gitversion.outputs.fullSemVer}}.nupkg