Publish release draft #4
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: Publish release draft | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: Release tag | |
required: true | |
prerelease: | |
description: Prerelease | |
type: boolean | |
generatenotes: | |
description: Generate release notes | |
type: boolean | |
jobs: | |
release-windows: | |
runs-on: windows-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
- name: Test | |
run: dotnet test --no-build --verbosity normal | |
- name: Publish for Windows x64 | |
run: dotnet publish Capy64/Capy64.csproj -c Release -a x64 --os win -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:TieredCompilation=false -o capy64-windows-x64 --self-contained | |
- name: Upload Windows x64 artifact | |
uses: actions/[email protected] | |
with: | |
name: Windows-x64 | |
path: capy64-windows-x64/** | |
if-no-files-found: error | |
- name: Zip Windows x64 | |
run: 7z a capy64-windows-x64.zip capy64-windows-x64/** | |
release-linux: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
- name: Test | |
run: dotnet test --no-build --verbosity normal | |
- name: Publish for Linux x64 | |
run: dotnet publish Capy64/Capy64.csproj -c Release -a x64 --os linux -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:TieredCompilation=false -o capy64-linux-x64 --self-contained | |
- name: Upload Linux x64 artifact | |
uses: actions/[email protected] | |
with: | |
name: Linux-x64 | |
path: capy64-linux-x64/** | |
if-no-files-found: error | |
- name: Zip Linux x64 | |
run: 7z a capy64-linux-x64.zip capy64-linux-x64/** | |
publish: | |
needs: [release-windows, release-linux] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Create Release | |
uses: ncipollo/[email protected] | |
with: | |
commit: ${{ github.ref_name }} | |
tag: ${{ inputs.tag }} | |
allowUpdates: true | |
artifactErrorsFailBuild: true | |
artifacts: "capy64-linux-x64.zip,capy64-windows-x64.zip" | |
draft: true | |
generateReleaseNotes: ${{ inputs.generatenotes }} | |
makeLatest: true | |
prerelease: ${{ inputs.prerelease }} |