Skip to content

Release

Release #4

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
description: Semantic version bump for the release
required: true
default: patch
type: choice
options:
- patch
- minor
- major
runtime:
description: Windows release target(s)
required: true
default: win-x86
type: choice
options:
- both
- win-x64
- win-x86
permissions:
contents: write
pull-requests: write
jobs:
release:
runs-on: windows-latest
steps:
- name: Check out source
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
# - name: Install .NET Framework 4.5.2 Developer Pack
# shell: pwsh
# run: |
# $installer = Join-Path $env:TEMP 'netfx452-devpack.exe'
# Invoke-WebRequest `
# -Uri 'https://go.microsoft.com/fwlink/?clcid=0x409&linkid=397673' `
# -OutFile $installer
# $process = Start-Process `
# -FilePath $installer `
# -ArgumentList '/q', '/norestart' `
# -Wait `
# -PassThru
# if ($process.ExitCode -notin 0, 3010) {
# throw "Developer Pack installation failed: $($process.ExitCode)"
# }
- name: Create GitHub release
uses: hsayed21/release-action@v1
with:
version: ${{ inputs.version }}
initial-version: '1.0.2'
generate-changelog: true
release-command-shell: pwsh
release-command: |
if ('${{ inputs.runtime }}' -eq 'both') {
./scripts/New-ReleaseZip.ps1 -Version $env:RELEASE_VERSION -Runtime win-x64
./scripts/New-ReleaseZip.ps1 -Version $env:RELEASE_VERSION -Runtime win-x86
}
else {
./scripts/New-ReleaseZip.ps1 -Version $env:RELEASE_VERSION -Runtime "${{ inputs.runtime }}"
}
files-pattern: artifacts/*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}