|
21 | 21 | default: false |
22 | 22 | type: boolean |
23 | 23 | workflowDebug: |
24 | | - description: 'If the workflow should be debugged (skip release)' |
| 24 | + description: 'If the workflow should be debugged (skips packaging and publishing)' |
| 25 | + default: true |
| 26 | + type: boolean |
| 27 | + packagingDebug: |
| 28 | + description: 'If the packaging step should be debugged (skips publishing)' |
| 29 | + default: true |
| 30 | + type: boolean |
| 31 | + skipForumPublish: |
| 32 | + description: 'If publishing to the forum should be skipped' |
25 | 33 | default: true |
26 | 34 | type: boolean |
27 | 35 |
|
|
33 | 41 | VERSION_SUFFIX: -beta |
34 | 42 |
|
35 | 43 | jobs: |
36 | | - build: |
| 44 | + build-linux: |
| 45 | + name: Build for Linux |
| 46 | + runs-on: ubuntu-latest |
| 47 | + steps: |
| 48 | + - name: Checkout Code |
| 49 | + uses: actions/checkout@v4 |
| 50 | + with: |
| 51 | + submodules: recursive |
37 | 52 |
|
38 | | - runs-on: windows-latest |
| 53 | + - name: Cache binaries |
| 54 | + uses: actions/cache@v3 |
| 55 | + id: cache-binaries |
| 56 | + with: |
| 57 | + key: ${{ runner.os }}-binaries-${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}-${{ hashFiles('Intersect*/**/*.cs*') }} |
| 58 | + path: | |
| 59 | + Intersect*/bin/Release/**/* |
| 60 | +
|
| 61 | + - name: Setup dotnet |
| 62 | + if: steps.cache-binaries.outputs.cache-hit != 'true' || inputs.forceBuild == true || inputs.forceRestore == true |
| 63 | + uses: actions/setup-dotnet@v3 |
| 64 | + with: |
| 65 | + dotnet-version: 7.0.x |
39 | 66 |
|
| 67 | + - name: Cache NuGet dependencies |
| 68 | + uses: actions/cache@v3 |
| 69 | + id: cache-nuget |
| 70 | + if: steps.cache-binaries.outputs.cache-hit != 'true' || inputs.forceBuild == true || inputs.forceRestore == true |
| 71 | + with: |
| 72 | + key: ${{ runner.os }}-nuget-${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}-${{ hashFiles('Intersect*/*.csproj') }} |
| 73 | + path: | |
| 74 | + ~/.nuget/packages |
| 75 | + Intersect*/obj/ |
| 76 | +
|
| 77 | + - name: Apply environment patches |
| 78 | + run: git apply disable-windows-editor.patch |
| 79 | + |
| 80 | + - name: Restore NuGet Packages |
| 81 | + if: steps.cache-binaries.outputs.cache-hit != 'true' && steps.cache-nuget.outputs.cache-hit != 'true' || inputs.forceRestore == true |
| 82 | + run: dotnet restore Intersect.sln |
| 83 | + |
| 84 | + - name: Build solution |
| 85 | + if: steps.cache-binaries.outputs.cache-hit != 'true' || inputs.forceBuild == true || inputs.forceRestore == true |
| 86 | + run: dotnet publish Intersect.sln --sc -r linux-x64 -p:Configuration=Release -p:PackageVersion=${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }}+build.${{ github.sha }} -p:Version=${{ env.VERSION_PREFIX }}.${{ github.run_number }} |
| 87 | + |
| 88 | + - name: Debug files on disk |
| 89 | + if: inputs.workflowDebug == true |
| 90 | + run: ls -R . |
| 91 | + |
| 92 | + - name: Upload artifacts |
| 93 | + uses: actions/upload-artifact@v3 |
| 94 | + with: |
| 95 | + if-no-files-found: error |
| 96 | + name: engine |
| 97 | + path: | |
| 98 | + ./Intersect.Client/bin/Release/*/*/publish |
| 99 | + ./Intersect.Editor/bin/Release/*/*/publish |
| 100 | + ./Intersect.Server/bin/Release/*/*/publish |
| 101 | +
|
| 102 | + build-macos: |
| 103 | + name: Build for MacOS |
| 104 | + runs-on: macos-latest |
40 | 105 | steps: |
41 | 106 | - name: Checkout Code |
42 | 107 | uses: actions/checkout@v4 |
@@ -67,69 +132,162 @@ jobs: |
67 | 132 | ~/.nuget/packages |
68 | 133 | Intersect*/obj/ |
69 | 134 |
|
| 135 | + - name: Apply environment patches |
| 136 | + run: git apply disable-windows-editor.patch |
| 137 | + |
70 | 138 | - name: Restore NuGet Packages |
71 | 139 | if: steps.cache-binaries.outputs.cache-hit != 'true' && steps.cache-nuget.outputs.cache-hit != 'true' || inputs.forceRestore == true |
72 | 140 | run: dotnet restore Intersect.sln |
73 | 141 |
|
74 | | - # - run: ls -R ~/.nuget/packages |
75 | | - |
76 | 142 | - name: Build solution |
77 | 143 | if: steps.cache-binaries.outputs.cache-hit != 'true' || inputs.forceBuild == true || inputs.forceRestore == true |
78 | | - run: | |
79 | | - dotnet publish Intersect.sln -r win-x64 -p:Configuration=Release -p:PackageVersion=${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }}+build.${{ github.sha }} -p:Version=${{ env.VERSION_PREFIX }}.${{ github.run_number }} |
80 | | - git apply disable-windows-editor.patch |
81 | | - dotnet publish Intersect.sln -r linux-x64 -p:Configuration=Release -p:PackageVersion=${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }}+build.${{ github.sha }} -p:Version=${{ env.VERSION_PREFIX }}.${{ github.run_number }} |
82 | | - dotnet publish Intersect.sln -r osx-x64 -p:Configuration=Release -p:PackageVersion=${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }}+build.${{ github.sha }} -p:Version=${{ env.VERSION_PREFIX }}.${{ github.run_number }} |
| 144 | + run: dotnet publish Intersect.sln --sc -r osx-x64 -p:Configuration=Release -p:PackageVersion=${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }}+build.${{ github.sha }} -p:Version=${{ env.VERSION_PREFIX }}.${{ github.run_number }} |
83 | 145 |
|
84 | | - # - name: Debug output of Build Solution |
85 | | - # run: ls -R |
| 146 | + - name: Debug files on disk |
| 147 | + if: inputs.workflowDebug == true |
| 148 | + run: ls -R . |
86 | 149 |
|
87 | | - - name: Checkout assets main_upgrade branch |
88 | | - uses: actions/checkout@v4 |
| 150 | + - name: Upload artifacts |
| 151 | + uses: actions/upload-artifact@v3 |
89 | 152 | with: |
90 | | - fetch-depth: 0 |
91 | | - path: assets_upgrade |
92 | | - repository: AscensionGameDev/Intersect-Assets |
93 | | - ref: main_upgrade |
94 | | - token: ${{ secrets.INTERSECTBOT_ACCESS_TOKEN }} |
| 153 | + if-no-files-found: error |
| 154 | + name: engine |
| 155 | + path: | |
| 156 | + ./Intersect.Client/bin/Release/*/*/publish |
| 157 | + ./Intersect.Editor/bin/Release/*/*/publish |
| 158 | + ./Intersect.Server/bin/Release/*/*/publish |
95 | 159 |
|
96 | | - - name: Checkout target main_full branch |
| 160 | + build-windows: |
| 161 | + name: Build for Windows |
| 162 | + runs-on: windows-latest |
| 163 | + steps: |
| 164 | + - name: Checkout Code |
97 | 165 | uses: actions/checkout@v4 |
98 | 166 | with: |
99 | | - fetch-depth: 0 |
100 | | - path: assets_full |
101 | | - repository: AscensionGameDev/Intersect-Assets |
102 | | - ref: main_full |
103 | | - token: ${{ secrets.INTERSECTBOT_ACCESS_TOKEN }} |
104 | | - |
105 | | - - name: Package artifacts |
106 | | - uses: AscensionGameDev/actions@cc2eb0e356546042e4dc7eca6788fd0b5a063b32 |
| 167 | + submodules: recursive |
| 168 | + |
| 169 | + - name: Cache binaries |
| 170 | + uses: actions/cache@v3 |
| 171 | + id: cache-binaries |
107 | 172 | with: |
108 | | - bundle: .github/bundles/*.json |
109 | | - version: ${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }}+build.${{ github.sha }} |
| 173 | + key: ${{ runner.os }}-binaries-${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}-${{ hashFiles('Intersect*/**/*.cs*') }} |
| 174 | + path: | |
| 175 | + Intersect*/bin/Release/**/* |
110 | 176 |
|
111 | | - - name: Publish GitHub Release |
112 | | - if: inputs.workflowDebug != true |
113 | | - |
| 177 | + - name: Setup dotnet |
| 178 | + if: steps.cache-binaries.outputs.cache-hit != 'true' || inputs.forceBuild == true || inputs.forceRestore == true |
| 179 | + uses: actions/setup-dotnet@v3 |
114 | 180 | with: |
115 | | - artifacts: "dist/**/*.zip" |
116 | | - commit: ${{ github.sha }} |
117 | | - generateReleaseNotes: true |
118 | | - name: ${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }} |
119 | | - prerelease: true |
120 | | - tag: v${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }} |
121 | | - |
122 | | - - name: Upload artifacts for workflow debugging |
123 | | - if: inputs.workflowDebug == true || failure() |
| 181 | + dotnet-version: 7.0.x |
| 182 | + |
| 183 | + - name: Cache NuGet dependencies |
| 184 | + uses: actions/cache@v3 |
| 185 | + id: cache-nuget |
| 186 | + if: steps.cache-binaries.outputs.cache-hit != 'true' || inputs.forceBuild == true || inputs.forceRestore == true |
| 187 | + with: |
| 188 | + key: ${{ runner.os }}-nuget-${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}-${{ hashFiles('Intersect*/*.csproj') }} |
| 189 | + path: | |
| 190 | + ~/.nuget/packages |
| 191 | + Intersect*/obj/ |
| 192 | +
|
| 193 | + - name: Apply environment patches |
| 194 | + run: echo "No patches to apply for Windows" |
| 195 | + |
| 196 | + - name: Restore NuGet Packages |
| 197 | + if: steps.cache-binaries.outputs.cache-hit != 'true' && steps.cache-nuget.outputs.cache-hit != 'true' || inputs.forceRestore == true |
| 198 | + run: dotnet restore Intersect.sln |
| 199 | + |
| 200 | + - name: Build solution |
| 201 | + if: steps.cache-binaries.outputs.cache-hit != 'true' || inputs.forceBuild == true || inputs.forceRestore == true |
| 202 | + run: dotnet publish Intersect.sln --sc -r win-x64 -p:Configuration=Release -p:PackageVersion=${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }}+build.${{ github.sha }} -p:Version=${{ env.VERSION_PREFIX }}.${{ github.run_number }} |
| 203 | + |
| 204 | + - name: Debug files on disk |
| 205 | + if: inputs.workflowDebug == true |
| 206 | + run: ls -R . |
| 207 | + |
| 208 | + - name: Upload artifacts |
124 | 209 | uses: actions/upload-artifact@v3 |
125 | 210 | with: |
126 | 211 | if-no-files-found: error |
127 | | - name: workflow-debug |
128 | | - path: "dist/**/*.zip" |
| 212 | + name: engine |
| 213 | + path: | |
| 214 | + ./Intersect.Client/bin/Release/*/*/publish |
| 215 | + ./Intersect.Editor/bin/Release/*/*/publish |
| 216 | + ./Intersect.Server/bin/Release/*/*/publish |
129 | 217 |
|
130 | | - publish: |
| 218 | + debug-build-artifacts: |
| 219 | + name: Debug Build Artifacts |
| 220 | + if: inputs.workflowDebug == true |
| 221 | + needs: [build-linux, build-macos, build-windows] |
| 222 | + runs-on: ubuntu-latest |
| 223 | + steps: |
| 224 | + - name: Download Artifacts |
| 225 | + uses: actions/download-artifact@v3 |
| 226 | + with: |
| 227 | + name: engine |
| 228 | + path: . |
| 229 | + |
| 230 | + - name: Debug output |
| 231 | + run: ls -R . |
| 232 | + |
| 233 | + publish-github: |
| 234 | + name: Publish GitHub Release |
131 | 235 | if: inputs.workflowDebug != true |
132 | | - needs: build |
| 236 | + needs: [build-linux, build-macos, build-windows] |
| 237 | + runs-on: ubuntu-latest |
| 238 | + steps: |
| 239 | + - name: Checkout Code |
| 240 | + uses: actions/checkout@v4 |
| 241 | + |
| 242 | + - name: Download Artifacts |
| 243 | + uses: actions/download-artifact@v3 |
| 244 | + with: |
| 245 | + name: engine |
| 246 | + path: . |
| 247 | + |
| 248 | + - name: Checkout assets main_upgrade branch |
| 249 | + uses: actions/checkout@v4 |
| 250 | + with: |
| 251 | + fetch-depth: 0 |
| 252 | + path: assets_upgrade |
| 253 | + repository: AscensionGameDev/Intersect-Assets |
| 254 | + ref: main_upgrade |
| 255 | + token: ${{ secrets.INTERSECTBOT_ACCESS_TOKEN }} |
| 256 | + |
| 257 | + - name: Checkout target main_full branch |
| 258 | + uses: actions/checkout@v4 |
| 259 | + with: |
| 260 | + fetch-depth: 0 |
| 261 | + path: assets_full |
| 262 | + repository: AscensionGameDev/Intersect-Assets |
| 263 | + ref: main_full |
| 264 | + token: ${{ secrets.INTERSECTBOT_ACCESS_TOKEN }} |
| 265 | + |
| 266 | + - name: Package artifacts |
| 267 | + uses: AscensionGameDev/actions@cc2eb0e356546042e4dc7eca6788fd0b5a063b32 |
| 268 | + with: |
| 269 | + bundle: .github/bundles/*.json |
| 270 | + version: ${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }}+build.${{ github.sha }} |
| 271 | + |
| 272 | + - name: Debug packaging output |
| 273 | + if: inputs.packagingDebug == true |
| 274 | + run: ls -R ./dist |
| 275 | + |
| 276 | + - name: Publish GitHub Release |
| 277 | + if: inputs.packagingDebug != true |
| 278 | + |
| 279 | + with: |
| 280 | + artifacts: "dist/**/*.zip" |
| 281 | + commit: ${{ github.sha }} |
| 282 | + generateReleaseNotes: true |
| 283 | + name: ${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }} |
| 284 | + prerelease: true |
| 285 | + tag: v${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }} |
| 286 | + |
| 287 | + publish-forum: |
| 288 | + name: Publish to Forum |
| 289 | + if: inputs.workflowDebug != true && inputs.packagingDebug != true && inputs.skipForumPublish != true |
| 290 | + needs: publish-github |
133 | 291 | runs-on: ubuntu-latest |
134 | 292 | steps: |
135 | 293 | - name: Publish to Forum |
|
0 commit comments