Package up Release. #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.fullSemVer }}" | |
# ------------------------ | |
# 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.fullSemVer}} | |
- 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.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/UmbCheckout.StarterKit.Stripe.${{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: false | |
files: | | |
./build.out/UmbCheckout.StarterKit.Stripe.${{steps.gitversion.outputs.fullSemVer}}.nupkg |