Skip to content

Fix an issue releasing from caveat with GH actions expressions #9

Fix an issue releasing from caveat with GH actions expressions

Fix an issue releasing from caveat with GH actions expressions #9

Workflow file for this run

name: Build and Release HsrGraphicsTool
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
architecture: [x86, x64]
self-contained: [true, false]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x' # Specify your .NET version here
- name: Restore dependencies
run: dotnet restore HsrGraphicsTool/HsrGraphicsTool.csproj
- name: Build project
run: |
dotnet publish HsrGraphicsTool/HsrGraphicsTool.csproj -c Release -r win-${{ matrix.architecture }} `--self-contained ${{ matrix.self-contained }}
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: HsrGraphicsTool-${{ matrix.architecture }}${{ matrix.self-contained == 'false' && '-fd' || '' }}
path: |
HsrGraphicsTool/bin/windows/Release/net8.0-windows/win-${{ matrix.architecture }}/publish/*
release:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
pattern: HsrGraphicsTool-x*
merge-multiple: false
- name: Rename executables by architecture
run: |
mv HsrGraphicsTool-x86/HsrGraphicsTool.exe HsrGraphicsTool_x86.exe && \
mv HsrGraphicsTool-x64/HsrGraphicsTool.exe HsrGraphicsTool_x64.exe && \
mv HsrGraphicsTool-x86-fd/HsrGraphicsTool.exe HsrGraphicsTool_x86_fd.exe && \
mv HsrGraphicsTool-x64-fd/HsrGraphicsTool.exe HsrGraphicsTool_x64_fd.exe
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
draft: false
prerelease: false
body: |
This is an automated release direct from source using GitHub Actions.
The '_fd' versions have smaller exe, but require the .NET 8 runtime to be installed.
files: |
HsrGraphicsTool_x86.exe
HsrGraphicsTool_x64.exe
HsrGraphicsTool_x64_fd.exe
HsrGraphicsTool_x86_fd.exe