Fix AssetManifest bundling, put resources in resources/ subdir #92
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 | |
on: | |
push: | |
branches: [ "main" ] | |
tags: | |
- '*' | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set version and ref name | |
id: version | |
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables | |
# GITHUB_REF_NAME will be either the current tag, for releases, or the branch name (all other builds) | |
# version-name is a semantically versioned string to use as the MSBuild $Version variable | |
# ref-name is GITHUB_REF_NAME but sanitised to replace slashes and spaces with dashes | |
run: | | |
echo "version-name=$( if [ $GITHUB_REF_TYPE = 'tag' ]; then echo $GITHUB_REF_NAME; else echo '0.0.0'; fi )" >> $GITHUB_OUTPUT && \ | |
echo "ref-name=$( echo $GITHUB_REF_NAME | sed 's/\//-/g' | sed 's/ /-/g' )" >> $GITHUB_OUTPUT | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0.x | |
- name: Check dotnet format | |
run: | | |
dotnet format analyzers --verify-no-changes && \ | |
dotnet format style --verify-no-changes | |
- name: Check csharpier formatting | |
run: dotnet tool restore && dotnet csharpier . --check | |
# - name: Test | |
# run: dotnet test --no-build --verbosity normal | |
- name: Make dirs | |
run: mkdir out_linux out_windows | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build Windows | |
run: | | |
dotnet publish -c Release /p:Version=${{ steps.version.outputs.version-name }} -r win-x64 -o out_windows/ src/Lumper.CLI && \ | |
dotnet publish -c Release /p:Version=${{ steps.version.outputs.version-name }} -r win-x64 -o out_windows/ src/Lumper.UI | |
- name: Build Linux | |
run: | | |
dotnet publish -c Release /p:Version=${{ steps.version.outputs.version-name }} -o out_linux/ src/Lumper.CLI && \ | |
dotnet publish -c Release /p:Version=${{ steps.version.outputs.version-name }} -o out_linux/ src/Lumper.UI | |
- name: Upload Windows artifacts | |
uses: actions/upload-artifact@v4.4.3 | |
with: | |
name: Lumper_${{ steps.version.outputs.ref-name }}_win-x64.zip | |
path: out_windows/ | |
- name: Upload Linux artifacts | |
uses: actions/upload-artifact@v4.4.3 | |
with: | |
name: Lumper_${{ steps.version.outputs.ref-name }}_linux-x64.zip | |
path: out_linux/ | |
- name: Package Windows | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
cd out_windows && \ | |
zip -r Lumper_${{ steps.version.outputs.ref-name }}_win-x64.zip \ | |
Lumper.CLI.exe \ | |
Lumper.UI.exe \ | |
NLog.config \ | |
RegisterLumperURLProtocol.ps1 \ | |
resources \ | |
&& cd .. | |
- name: Package Linux | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
cd out_linux && \ | |
zip -r Lumper_${{ steps.version.outputs.ref-name }}_linux-x64.zip \ | |
Lumper.CLI \ | |
Lumper.UI \ | |
NLog.config \ | |
resources \ | |
&& cd .. | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
generate_release_notes: true | |
files: | | |
out_windows/Lumper_${{ steps.version.outputs.ref-name }}_win-x64.zip | |
out_linux/Lumper_${{ steps.version.outputs.ref-name }}_linux-x64.zip | |