Package up Prerelease. #3
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 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/[email protected] | |
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/[email protected] | |
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/Our.Umbraco.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/Our.Umbraco.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/Our.Umbraco.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/Our.Umbraco.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/Our.Umbraco.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/Our.Umbraco.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/[email protected]" | |
with: | |
name: ${{steps.gitversion.outputs.fullSemVer}} | |
tag_name: ${{steps.gitversion.outputs.fullSemVer}} | |
prerelease: true | |
generate_release_notes: true | |
files: | | |
./build.out/Our.Umbraco.UmbNav.Web.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg | |
./build.out/Our.Umbraco.UmbNav.Core.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg | |
./build.out/Our.Umbraco.UmbNav.Api.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg |