Use the correct action for GitHub release #4
Workflow file for this run
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: Build and Release HsrGraphicsTool | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
architecture: [x86, x64] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
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 true /p:PublishSingleFile=true | |
- name: Archive build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: HsrGraphicsTool-${{ matrix.architecture }} | |
path: | | |
HsrGraphicsTool/bin/windows/Release/net8.0-windows/win-${{ matrix.architecture }}/publish/* | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download build artifacts x86 | |
uses: actions/download-artifact@v3 | |
with: | |
name: HsrGraphicsTool-x86 | |
- name: Download build artifacts x64 | |
uses: actions/download-artifact@v3 | |
with: | |
name: HsrGraphicsTool-x64 | |
- name: Rename executables by architecture | |
run: | | |
mv HsrGraphicsTool-x86/HsrGraphicsTool.exe HsrGraphicsTool_x86.exe && \ | |
mv HsrGraphicsTool-x64/HsrGraphicsTool.exe HsrGraphicsTool_x64.exe | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: false | |
prerelease: false | |
files: | | |
HsrGraphicsTool_x86.exe | |
HsrGraphicsTool_x64.exe |