.NET Pre-Release #12
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 | |
checks: 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 WinFormsThemes/WinFormsThemes.sln | |
- name: set prerelease version | |
run: (Get-Content WinFormsThemes/WinFormsThemes/WinFormsThemes.csproj) -replace '<Version>(\d+\.\d+.\d+)</Version>', "<Version>`$1-$Env:SUFFIX</Version>" | Out-File WinFormsThemes/WinFormsThemes/WinFormsThemes.csproj | |
env: | |
SUFFIX: ${{ inputs.type }}.${{ inputs.number }} | |
- name: Build | |
run: dotnet build WinFormsThemes/WinFormsThemes.sln -c Release --no-restore | |
- name: run unittests | |
uses: zyborg/dotnet-tests-report@v1 | |
with: | |
project_path: WinFormsThemes/TestProject | |
report_name: Unittests | |
report_title: Unittests | |
set_check_status_from_test_outcome: true | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "latest" | |
prerelease: true | |
title: "Development Build" | |
files: | | |
LICENSE | |
WinFormsThemes/WinFormsThemes/bin/Release/net6.0-windows/WinFormsThemes.dll | |
WinFormsThemes/WinFormsThemes/bin/Release/*.nupkg | |
WinFormsThemes/WinFormsThemes/bin/Release/*.snupkg | |
- name: Pack nugets | |
run: dotnet pack WinFormsThemes/WinFormsThemes/WinFormsThemes.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 | |