1+ name : Release Plugin
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ version :
7+ description : ' Release version'
8+ required : true
9+ type : string
10+ publish_profile :
11+ description : ' Publish profile to use'
12+ required : true
13+ type : choice
14+ options :
15+ - ReleaseNoReflectionPublish-O1
16+ - ReleaseNoReflectionPublish-O2
17+ - ReleasePublish-O1
18+ - ReleasePublish-O2
19+ - DebugPublish
20+ - DebugNoReflectionPublish
21+ default : ReleaseNoReflectionPublish-O1
22+
23+ permissions :
24+ id-token : write
25+ contents : write
26+ attestations : write
27+
28+ jobs :
29+ release :
30+ runs-on : windows-latest
31+
32+ steps :
33+ - name : Checkout code
34+ uses : actions/checkout@v4
35+ with :
36+ fetch-depth : 0 # Fetch full history for changelog
37+ submodules : true
38+
39+ - name : Setup .NET
40+ uses : actions/setup-dotnet@v4
41+ with :
42+ dotnet-version : ' 10.0.x'
43+
44+ - name : Restore dependencies
45+ run : dotnet restore Hi3Helper.Plugin.DNA.sln
46+
47+ - name : Build solution
48+ run : dotnet build --configuration Release Hi3Helper.Plugin.DNA.sln --no-restore
49+
50+ - name : Publish with selected profile
51+ run : dotnet publish Hi3Helper.Plugin.DNA/Hi3Helper.Plugin.DNA.csproj --configuration Release --runtime win-x64 /p:PublishProfile=${{ inputs.publish_profile }} -o ./publish
52+
53+ - name : Generate build provenance
54+ uses : actions/attest-build-provenance@v1
55+ with :
56+ subject-path : ' ./publish/**'
57+
58+ - name : Run Indexer
59+ run : .\Indexer.exe .\publish
60+
61+ - name : Generate Changelog
62+ uses : orhun/git-cliff-action@v4
63+ with :
64+ configuration : cliff.toml
65+ args : --latest --strip header
66+ id : git-cliff
67+
68+ - name : Create Release
69+ uses : softprops/action-gh-release@v2
70+ with :
71+ tag_name : v${{ inputs.version }}
72+ name : Release v${{ inputs.version }}
73+ body : ${{ steps.git-cliff.outputs.content }}
74+ files : ./publish/*.zip
75+ env :
76+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
77+
78+ - name : Checkout target repo
79+ uses : actions/checkout@v4
80+ with :
81+ repository : CollapseLauncher/CollapseLauncher-ReleaseRepo
82+ path : ./target-repo
83+ token : ${{ secrets.RELEASE_REPO_TOKEN }}
84+
85+ - name : Copy files to target repo
86+ run : |
87+ New-Item -ItemType Directory -Force -Path ./target-repo/inhouse-plugin/duetnightabyss/build
88+ Copy-Item -Path ./publish/DNAbyss.dll -Destination ./target-repo/inhouse-plugin/duetnightabyss/
89+ Copy-Item -Path ./publish/DNAbyss.pdb -Destination ./target-repo/inhouse-plugin/duetnightabyss/
90+ Copy-Item -Path ./publish/manifest.json -Destination ./target-repo/inhouse-plugin/duetnightabyss/
91+ Copy-Item -Path ./publish/SevenZipExtractor.pdb -Destination ./target-repo/inhouse-plugin/duetnightabyss/
92+ Copy-Item -Path ./publish/Lib/7z.dll -Destination ./target-repo/inhouse-plugin/duetnightabyss/Lib/
93+ Copy-Item -Path ./publish/*.zip -Destination ./target-repo/inhouse-plugin/duetnightabyss/build/
94+
95+ - name : Create Pull Request in Release Repo
96+ uses : peter-evans/create-pull-request@v7
97+ with :
98+ token : ${{ secrets.RELEASE_REPO_TOKEN }}
99+ path : ./target-repo
100+ branch : dna-plugin-release-${{ inputs.version }}
101+ base : main
102+ title : ' Release DNA Plugin v${{ inputs.version }}'
103+ body : |
104+ Automated release of DNA Plugin v${{ inputs.version }}
105+
106+ ${{ steps.git-cliff.outputs.content }}
107+
108+ Files updated:
109+ - DNAbyss.dll
110+ - DNAbyss.pdb
111+ - manifest.json
112+ - SevenZipExtractor.pdb
113+ - Lib/7z.dll
114+ - build/*.zip
115+ commit-message : ' Release DNA Plugin v${{ inputs.version }}'
116+ delete-branch : false
0 commit comments