Release Plugin #21
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: Release Plugin | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release version' | |
| required: true | |
| type: string | |
| 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 | |
| permissions: | |
| id-token: write | |
| contents: write | |
| attestations: write | |
| pull-requests: write | |
| jobs: | |
| release: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore Hi3Helper.Plugin.Wuwa.sln | |
| - name: Build solution | |
| run: dotnet build --configuration Release 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@v3 | |
| with: | |
| subject-path: './publish/**' | |
| # --- STEP 1: Zip Clean Files (Before Indexer runs) --- | |
| # We save this OUTSIDE the publish folder so Indexer doesn't process it. | |
| - name: Create Clean Release Zip | |
| run: Compress-Archive -Path ./publish/* -DestinationPath ./Waves_v${{ inputs.version }}.zip | |
| # --- STEP 2: Indexer (Modifies publish folder) --- | |
| # This generates the .br files and the Launcher-specific zip inside ./publish | |
| - name: Run Indexer | |
| run: .\Indexer.exe .\publish | |
| # --- STEP 4: Generate Changelog --- | |
| - name: Generate Changelog | |
| uses: orhun/git-cliff-action@v4 | |
| with: | |
| config: cliff.toml | |
| # (Implicitly grabs all "unreleased" changes since v0.4.0) | |
| args: --unreleased --tag v${{ inputs.version }} --strip header | |
| id: git-cliff | |
| # --- STEP 5: Create GitHub Release --- | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ inputs.version }} | |
| name: Release v${{ inputs.version }} | |
| body: ${{ steps.git-cliff.outputs.content }} | |
| # Upload zip with correct manifest from step 2 | |
| files: ./publish/*.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Checkout target repo | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: CollapseLauncher/CollapseLauncher-ReleaseRepo | |
| path: ./target-repo | |
| token: ${{ secrets.RELEASE_REPO_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Copy files to target repo | |
| run: | | |
| New-Item -ItemType Directory -Force -Path ./target-repo/inhouse-plugin/wuwa/build | |
| Copy-Item -Path ./publish/Waves.dll -Destination ./target-repo/inhouse-plugin/wuwa/ | |
| Copy-Item -Path ./publish/Waves.pdb -Destination ./target-repo/inhouse-plugin/wuwa/ | |
| Copy-Item -Path ./publish/manifest.json -Destination ./target-repo/inhouse-plugin/wuwa/ | |
| Copy-Item -Path ./publish/*.zip -Destination ./target-repo/inhouse-plugin/wuwa/build/ | |
| - name: Create Pull Request in Release Repo | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| token: ${{ secrets.RELEASE_REPO_TOKEN }} | |
| path: ./target-repo | |
| branch: wuwa-plugin-release-${{ inputs.version }} | |
| base: main | |
| title: 'Release Wuwa Plugin v${{ inputs.version }}' | |
| body: | | |
| Automated release of Wuwa Plugin v${{ inputs.version }} | |
| ${{ steps.git-cliff.outputs.content }} | |
| Files updated: | |
| - Waves.dll | |
| - Waves.pdb | |
| - manifest.json | |
| - build/*.zip | |
| commit-message: 'Release Wuwa Plugin v${{ inputs.version }}' | |
| delete-branch: false |