Skip to content
name: Publish Standalone
on:
push:
tags:
- 'v*'
env:
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending .NET CLI telemetry to Microsoft.
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.create_release.outputs.id }}
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: true
publish-native:
strategy:
matrix:
data: [
{ rid: 'win-x64', os: 'windows-latest' },
{ rid: 'win-x86', os: 'windows-latest' },
{ rid: 'linux-x64', os: 'ubuntu-latest' },
{ rid: 'osx-x64', os: 'macos-13' },
{ rid: 'osx-arm64', os: 'macos-latest' }
]
name: Publish Native ${{ matrix.data.rid }}
runs-on: ${{ matrix.data.os }}
needs: create-release
steps:
- name: Setup
uses: butr/actions-common-setup@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x.x
- name: Run _build
run: >-
dotnet publish src/BUTR.CrashReport.Renderer.ImGui.Standalone/BUTR.CrashReport.Renderer.ImGui.Standalone.csproj --configuration Release -f net9.0 -r "${{ matrix.data.rid }}" -o "./pub";
Compress-Archive -Path pub/* -Destination "native-${{ matrix.data.rid }}.zip"
shell: pwsh
- name: Upload Release Assets
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.create-release.outputs.release_id }}
assets_path: "native-${{ matrix.data.rid }}.zip"
publish-universal:
strategy:
matrix:
data: [
{ rid: 'win', os: 'windows-latest' },
{ rid: 'linux', os: 'ubuntu-latest' },
{ rid: 'osx', os: 'macos-latest' }
]
name: Publish Universal ${{ matrix.data.rid }}
runs-on: ${{ matrix.data.os }}
needs: create-release
steps:
- name: Setup
uses: butr/actions-common-setup@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x.x
- name: Run _build
run: >-
dotnet publish src/BUTR.CrashReport.Renderer.ImGui.Standalone/BUTR.CrashReport.Renderer.ImGui.Standalone.csproj --configuration Release -f net6.0 -p:Runtime=true -o "./pub";
Compress-Archive -Path pub/* -Destination "net6-${{ matrix.data.rid }}.zip"
dotnet publish src/BUTR.CrashReport.Renderer.ImGui.Standalone/BUTR.CrashReport.Renderer.ImGui.Standalone.csproj --configuration Release -f net6.0 -p:RuntimeSingleFile=true -o "./pub2";
Compress-Archive -Path pub2/* -Destination "net6-${{ matrix.data.rid }}-single-file.zip"
shell: pwsh
- name: Upload Release Assets
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.create-release.outputs.release_id }}
assets_path: "net6-${{ matrix.data.rid }}.zip"
- name: Upload Release Assets
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.create-release.outputs.release_id }}
assets_path: "net6-${{ matrix.data.rid }}-single-file.zip"