Add all build profiles to manual workflow dispatch & clone submodules #3
This file contains hidden or 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 Publish Plugin | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| inputs: | |
| publish_profile: | |
| description: 'Publish profile to use' | |
| required: true | |
| type: choice | |
| options: | |
| - ReleaseNoReflectionPublish-O1 | |
| - ReleaseNoReflectionPublish-O2 | |
| - ReleasePublish-O1 | |
| - ReleasePublish-O2 | |
| - DebugPublish | |
| - DebugNoReflectionPublish | |
| default: ReleaseNoReflectionPublish-O1 | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore --runtime win-x64 Hi3Helper.Plugin.Wuwa.sln | |
| - name: Build solution | |
| run: dotnet build --configuration Release --runtime win-x64 Hi3Helper.Plugin.Wuwa.sln --no-restore | |
| - name: Publish with selected profile | |
| run: dotnet publish Hi3Helper.Plugin.Wuwa/Hi3Helper.Plugin.Wuwa.csproj --configuration Release --runtime win-x64 /p:PublishProfile=${{ inputs.publish_profile }} -o ./publish | |
| - name: Generate build provenance | |
| uses: actions/attest-build-provenance@v1 | |
| with: | |
| subject-path: './publish/**' | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: plugin-build | |
| path: ./publish/ |