Release Plugin #1
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 | |
| jobs: | |
| release: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch full history for changelog | |
| submodules: true | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore Hi3Helper.Plugin.DNA.sln | |
| - name: Build solution | |
| run: dotnet build --configuration Release Hi3Helper.Plugin.DNA.sln --no-restore | |
| - name: Publish with selected profile | |
| run: dotnet publish Hi3Helper.Plugin.DNA/Hi3Helper.Plugin.DNA.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: Run Indexer | |
| run: .\Indexer.exe .\publish | |
| - name: Generate Changelog | |
| uses: orhun/git-cliff-action@v4 | |
| with: | |
| configuration: cliff.toml | |
| args: --latest --strip header | |
| id: git-cliff | |
| - 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 }} | |
| files: ./publish/*.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Checkout target repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: CollapseLauncher/CollapseLauncher-ReleaseRepo | |
| path: ./target-repo | |
| token: ${{ secrets.RELEASE_REPO_TOKEN }} | |
| - name: Copy files to target repo | |
| run: | | |
| New-Item -ItemType Directory -Force -Path ./target-repo/inhouse-plugin/duetnightabyss/build | |
| Copy-Item -Path ./publish/DNAbyss.dll -Destination ./target-repo/inhouse-plugin/duetnightabyss/ | |
| Copy-Item -Path ./publish/DNAbyss.pdb -Destination ./target-repo/inhouse-plugin/duetnightabyss/ | |
| Copy-Item -Path ./publish/manifest.json -Destination ./target-repo/inhouse-plugin/duetnightabyss/ | |
| Copy-Item -Path ./publish/SevenZipExtractor.pdb -Destination ./target-repo/inhouse-plugin/duetnightabyss/ | |
| Copy-Item -Path ./publish/Lib/7z.dll -Destination ./target-repo/inhouse-plugin/duetnightabyss/Lib/ | |
| Copy-Item -Path ./publish/*.zip -Destination ./target-repo/inhouse-plugin/duetnightabyss/build/ | |
| - name: Create Pull Request in Release Repo | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ secrets.RELEASE_REPO_TOKEN }} | |
| path: ./target-repo | |
| branch: dna-plugin-release-${{ inputs.version }} | |
| base: main | |
| title: 'Release DNA Plugin v${{ inputs.version }}' | |
| body: | | |
| Automated release of DNA Plugin v${{ inputs.version }} | |
| ${{ steps.git-cliff.outputs.content }} | |
| Files updated: | |
| - DNAbyss.dll | |
| - DNAbyss.pdb | |
| - manifest.json | |
| - SevenZipExtractor.pdb | |
| - Lib/7z.dll | |
| - build/*.zip | |
| commit-message: 'Release DNA Plugin v${{ inputs.version }}' | |
| delete-branch: false |