Skip to content

#27 - zip binaries #164

#27 - zip binaries

#27 - zip binaries #164

name: "01 - Build, Test, Publish"
on:
push:
# run on all commits
pull_request:
# run on all pull requests
workflow_dispatch:
# allows you to run this workflow manually from the Actions tab
jobs:
build_test_publish:
runs-on: windows-latest
defaults:
run:
shell: bash
env:
BUILD_PATH: ./src
CONFIG_NAME: Release
# relative to BUILD_PATH
PUBLISH_PATH: ../.build/app
steps:
- uses: actions/checkout@v3
with:
# needed for gitversion to work
fetch-depth: 0
- name: setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: dotnet version
working-directory: ${{ env.BUILD_PATH }}
run: dotnet --version
- name: dotnet restore
working-directory: ${{ env.BUILD_PATH }}
run: dotnet restore
- name: dotnet build
working-directory: ${{ env.BUILD_PATH }}
run: dotnet build --configuration "$CONFIG_NAME" --no-restore
- name: dotnet test
working-directory: ${{ env.BUILD_PATH }}
run: dotnet test --configuration "$CONFIG_NAME" --no-build --filter "TestCategory!=Performance"
- name: dotnet publish
working-directory: ${{ env.BUILD_PATH }}
run: dotnet publish "./FancyMouse/FancyMouse.csproj" --configuration "$CONFIG_NAME" --no-build --output "$PUBLISH_PATH"
- name: upload binaries
uses: actions/upload-artifact@v3
with:
name: app
path: .build/app
- name: dotnet tool jb inspectcode
working-directory: ${{ env.BUILD_PATH }}
run: |
dotnet new tool-manifest
dotnet tool install jetbrains.resharper.globaltools
dotnet tool run jb inspectcode "./FancyMouse.sln" -output="../.build/out/jb-inspectcode.xml" --no-build
- name: upload jb-inspectcode.xml
uses: actions/upload-artifact@v3
with:
name: jb-inspectcode.xml
path: .build/out/jb-inspectcode.xml
- name: zip
working-directory: ${{ env.BUILD_PATH }}
run: |
sudo apt-get update
sudo apt-get install -y zip
echo "version = ${{ github.ref_name }}"
zip -r "$PUBLISH_PATH" FancyMouse-${{ github.ref_name }}.zip