Release build for Wiinject #8
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: Wiinject Release | |
| run-name: "Release build for Wiinject" | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Release version | |
| required: true | |
| type: string | |
| releaseNotes: | |
| description: Release notes | |
| required: true | |
| type: string | |
| skip_nuget: | |
| description: 'Skip NuGet Publish' | |
| required: true | |
| default: false | |
| type: 'boolean' | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| type: | |
| - { rid: 'linux-x64', image: 'ubuntu-latest' } | |
| - { rid: 'linux-arm64', image: 'ubuntu-24.04-arm' } | |
| - { rid: 'osx-x64', image: 'macos-latest' } | |
| - { rid: 'osx-arm64', image: 'macos-latest' } | |
| - { rid: 'win-x64', image: 'windows-latest' } | |
| - { rid: 'win-arm64', image: 'windows-latest' } | |
| runs-on: ${{ matrix.type.image }} | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4.1.0 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Build & Publish Wiinject | |
| run: dotnet publish ./HaroohieClub.Wiinject.Cli/HaroohieClub.Wiinject.Cli.csproj -c Release -f net10.0 -r ${{ matrix.type.rid }} --self-contained /p:DebugType=None /p:DebugSymbols=false /p:PublishSingleFile=true | |
| env: | |
| WiinjectVersion: ${{ inputs.version }} | |
| - name: Create zip | |
| shell: pwsh | |
| run: | | |
| Compress-Archive -Path ./HaroohieClub.Wiinject.Cli/bin/Release/net10.0/${{ matrix.type.rid }}/publish/ -DestinationPath ./HaroohieClub.Wiinject.Cli/bin/Release/net10.0/${{ matrix.type.rid }}/Wiinject-${{ inputs.version }}-${{ matrix.type.rid }}.zip | |
| - name: Upload zip | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.type.rid }} | |
| path: ./HaroohieClub.Wiinject.Cli/bin/Release/net10.0/${{ matrix.type.rid }}/Wiinject-${{ inputs.version }}-${{ matrix.type.rid }}.zip | |
| retention-days: 1 | |
| publish-package: | |
| name: 'Publish NuGet Package' | |
| if: ${{ !inputs.skip_nuget }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5.0.0 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Build Wiinject package | |
| run: | | |
| dotnet pack HaroohieClub.Wiinject/HaroohieClub.Wiinject.csproj | |
| - name: NuGet login (OIDC → temp API key) | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: jonko0493 | |
| - name: Push package | |
| run: | | |
| dotnet nuget push -s nuget.org -k ${{ steps.login.outputs.NUGET_API_KEY }} HaroohieClub.Wiinject/bin/Release/HaroohieClub.Wiinject.${{ inputs.version }}.nupkg | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download linux-x64 | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: linux-x64 | |
| - name: Download linux-arm64 | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: linux-arm64 | |
| - name: Download macos-x64 | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: osx-x64 | |
| - name: Download macos-arm64 | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: osx-arm64 | |
| - name: Download win-x64 | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: win-x64 | |
| - name: Download win-arm64 | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: win-arm64 | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: Wiinject v${{ inputs.version }} | |
| tag_name: ${{ inputs.version }} | |
| prerelease: false | |
| generate_release_notes: true | |
| files: ./* | |
| body: ${{ inputs.releaseNotes }} |