.NET Pre-Release #27
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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: .NET Pre-Release | |
on: | |
workflow_dispatch: | |
inputs: | |
type: | |
description: 'the type of the prerelease' | |
required: true | |
default: 'beta' | |
type: choice | |
options: | |
- alpha | |
- beta | |
number: | |
description: 'the number of the prerelease, e.g. 2 for beta-2' | |
required: true | |
default: "1" | |
type: string | |
jobs: | |
build: | |
permissions: | |
contents: write | |
runs-on: windows-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: checkout project | |
uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: dotnet restore StylableWinFormsControls/StylableWinFormsControls.sln | |
- name: set prerelease version | |
run: (Get-Content StylableWinFormsControls/StylableWinFormsControls/StylableWinFormsControls.csproj) -replace '<Version>(\d+\.\d+.\d+)</Version>', "<Version>`$1-$Env:SUFFIX</Version>" | Out-File StylableWinFormsControls/StylableWinFormsControls/StylableWinFormsControls.csproj | |
env: | |
SUFFIX: ${{ inputs.type }}.${{ inputs.number }} | |
- name: Build | |
run: dotnet build StylableWinFormsControls/StylableWinFormsControls.sln -c Release --no-restore | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "latest" | |
prerelease: true | |
title: "Development Build" | |
files: | | |
LICENSE | |
StylableWinFormsControls/StylableWinFormsControls/bin/Release/net6.0-windows/StylableWinFormsControls.dll | |
StylableWinFormsControls/StylableWinFormsControls/bin/Release/*.nupkg | |
StylableWinFormsControls/StylableWinFormsControls/bin/Release/*.snupkg | |
- name: Pack nugets | |
run: dotnet pack StylableWinFormsControls/StylableWinFormsControls/StylableWinFormsControls.csproj -c Release --no-build --output . | |
- name: Push to NuGet | |
run: dotnet nuget push *.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json | |