Skip to content

Package up Release. #20

Package up Release.

Package up Release. #20

name: Package up Release.
on:
workflow_dispatch:
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: "6.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: main
- 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-starterkit-stripe
- 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.majorMinorPatch }}"
# ------------------------
# actual builds / packages
# ------------------------
- name: Restore UmbCheckout.StarterKit.Stripe
run: dotnet restore ./template-pack.csproj
- name: Build UmbCheckout.StarterKit.Stripe
run: dotnet pack ./template-pack.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.majorMinorPatch}}
- name: Push to UmbHost GitHub Nuget Repo
if: ${{ github.event_name != 'pull_request' }}
run: |
dotnet nuget push ./build.out/UmbCheckout.StarterKit.Stripe.${{steps.gitversion.outputs.majorMinorPatch}}.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/UmbCheckout.StarterKit.Stripe.${{steps.gitversion.outputs.majorMinorPatch}}.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.majorMinorPatch}}
tag_name: ${{steps.gitversion.outputs.majorMinorPatch}}
prerelease: false
files: |
./build.out/UmbCheckout.StarterKit.Stripe.${{steps.gitversion.outputs.majorMinorPatch}}.nupkg