Skip to content

Tidy up the class library #57

Tidy up the class library

Tidy up the class library #57

Workflow file for this run

# SPDX-FileCopyrightText: Public Domain
# SPDX-License-Identifier: CC0-1.0
name: Native AOT Build
on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
branches:
- main
permissions: # added using https://github.com/step-security/secure-repo
contents: read
jobs:
REUSE_compliance_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: REUSE Compliance Check
uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5.0.0
publish_aot:
strategy:
matrix:
target_runtime: [ x64, arm64 ]
build_config: [ Release, Debug ]
plugin_demo: [ minimal, gui, fsharp, vbnet ]
runs-on: windows-latest
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
PLUGIN_NS: 'Npp.DotNet.Plugin'
PLUGIN_NAME: 'Npp.DotNet.Plugin.Demo'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-dotnet@3951f0dfe7a07e2313ec93c75700083e2005cbab # v4.3.0
with:
dotnet-version: >
8.0.x
9.0.x
- name: Restore projects
run: |
dotnet restore
dotnet restore test
- name: Run tests
if: matrix.build_config == 'Debug' && matrix.plugin_demo == 'minimal'
working-directory: ./test
run: |
dotnet msbuild /t:Build /p:SharedFramework=net9.0-windows /p:SharedRuntimeIdentifier=win-${{ matrix.target_runtime }}
dotnet test -f net9.0-windows --no-build
- name: Build demo plugins
run: |
dotnet build examples\${{ matrix.plugin_demo }} -f net9.0-windows -r win-${{ matrix.target_runtime }} -c ${{ matrix.build_config }}
dotnet publish examples\${{ matrix.plugin_demo }} -f net9.0-windows -r win-${{ matrix.target_runtime }} -c ${{ matrix.build_config }}
- name: Pack localized plugin assets
if: matrix.build_config == 'Release' && matrix.plugin_demo == 'minimal'
working-directory: examples/minimal/bin/Release/net9.0-windows/win-${{ matrix.target_runtime }}/native
run: |
7z a -tzip ${{ env.PLUGIN_NAME }}.${{ matrix.target_runtime }}.zip ${{ env.PLUGIN_NAME }}.dll ${{ github.workspace }}\examples\minimal\localizations -y
- name: Upload ${{ env.PLUGIN_NAME }}.${{ matrix.target_runtime }}
if: matrix.build_config == 'Release' && matrix.plugin_demo == 'minimal'
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: ${{ env.PLUGIN_NAME }}.${{ matrix.target_runtime }}
path: examples/minimal/bin/Release/net9.0-windows/win-${{ matrix.target_runtime }}/native/${{ env.PLUGIN_NAME }}.${{ matrix.target_runtime }}.zip
- name: Upload ${{ env.PLUGIN_NS }}.VBNet.Demo.${{ matrix.target_runtime }}
if: matrix.build_config == 'Release' && matrix.plugin_demo == 'vbnet'
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: ${{ env.PLUGIN_NS }}.VBNet.Demo.${{ matrix.target_runtime }}
path: examples/vbnet/bin/Release/net9.0-windows/win-${{ matrix.target_runtime }}/native/${{ env.PLUGIN_NS }}.VBNet.Demo.dll
- name: Upload ${{ env.PLUGIN_NS }}.FSharp.Demo.${{ matrix.target_runtime }}
if: matrix.build_config == 'Release' && matrix.plugin_demo == 'fsharp'
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: ${{ env.PLUGIN_NS }}.FSharp.Demo.${{ matrix.target_runtime }}
path: examples/fsharp/bin/Release/net9.0-windows/win-${{ matrix.target_runtime }}/native/${{ env.PLUGIN_NS }}.FSharp.Demo.dll