Use updated versions of the upload/download artifact action #5
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@v4 | |
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 | |
uses: actions/download-artifact@v4 | |
with: | |
name: HsrGraphicsTool-x86 | |
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 | |
- 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 |