Create Draft Release #5
Workflow file for this run
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: Create Draft Release | |
# The use of this workflow is to trigger it temporary. | |
# In a later step this workflow should be merged back to workflow -Test Code-. | |
on: | |
push: | |
tags: | |
- "v*" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Avoid pre-populating the NuGet package cache | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # all | |
- name: Setup .NET 7.0 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: Cake Build 🏗️ | |
id: cake-build | |
shell: powershell | |
run: ./build.ps1 | |
env: | |
OCTOVERSION_CurrentBranch: ${{ github.ref }} | |
- name: Push NuGet packages to GitHub Packages ⬆️ | |
working-directory: artifacts | |
run: dotnet nuget push *.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/DbUp/index.json" | |
- name: "Create Draft Release" | |
if: ${{ format('{0}', github.ref_name) == 'master' && format('{0}', env.GITHUB_TOKEN) != '' }} | |
shell: pwsh | |
working-directory: artifacts | |
# Can't just use wildcard in this command due to https://github.com/cli/cli/issues/5099 so use Get-Item | |
run: gh release create --draft --title "${{ steps.cake-build.outputs.Version_Info_SemVer }}" "${{ steps.cake-build.outputs.Version_Info_SemVer }}" (Get-Item dbup-core.*.nupkg) | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Moved Test report into separate workflow | |
# https://github.com/dorny/test-reporter#recommended-setup-for-public-repositories |