|
1 | 1 | name: "Release Build" |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - tags: |
6 | | - - "v*.*.*.*" |
| 4 | + release: |
| 5 | + types: [published] |
7 | 6 |
|
8 | 7 | env: |
9 | | - RELEASE_NAME: ${{ github.ref_name }} |
10 | | - ARTIFACT_NAME: CnCNet-Spawner_${{ github.ref_name }} |
11 | | - |
12 | | - SOLUTION_PATH: . |
13 | | - BUILD_CONFIGURATION: Release |
| 8 | + BUILD_CONFIG: ${{ matrix.build-type }}${{ matrix.is-cncnet-yr }}${{ matrix.is-hardened }} |
| 9 | + ARCHIVE_NAME: CnCNet-Spawner${{ matrix.is-cncnet-yr }}${{ matrix.is-hardened }}-${{ github.ref_name }}.zip |
14 | 10 |
|
15 | 11 | jobs: |
16 | 12 | build: |
17 | 13 | runs-on: windows-2019 |
18 | 14 |
|
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + build-type: [Release] # [Debug, DevBuild, Release] |
| 18 | + is-cncnet-yr: ['', -CnCNetYR] |
| 19 | + is-hardened: ['', -Hardened] |
| 20 | + |
19 | 21 | steps: |
20 | 22 | - uses: actions/checkout@v4 |
21 | 23 | with: |
22 | 24 | submodules: recursive |
| 25 | + ssh-key: ${{ secrets.CNCNET_CI_SSH_PRIVATEKEY }} |
23 | 26 |
|
24 | 27 | - name: Build |
25 | 28 | uses: ./.github/actions/build |
26 | 29 | with: |
27 | | - sln-path: ${{ env.SOLUTION_PATH }} |
28 | | - build-config: ${{ env.BUILD_CONFIGURATION }} |
29 | | - artifact-name: compiled-dll-regular-${{ github.sha }} |
30 | | - |
31 | | - - name: Build HardEnd |
32 | | - uses: ./.github/actions/build |
33 | | - with: |
34 | | - sln-path: ${{ env.SOLUTION_PATH }} |
35 | | - build-config: ${{ env.BUILD_CONFIGURATION }}-HardEnd |
36 | | - artifact-name: compiled-dll-hardend-${{ github.sha }} |
| 30 | + build-config: ${{ env.BUILD_CONFIG }} |
37 | 31 |
|
38 | | - - name: Create Archive For Release |
39 | | - run: | |
40 | | - mkdir ./artifact |
41 | | - mkdir ./artifact/Regular |
42 | | - copy ./LICENSE.md ./artifact/Regular/LICENSE.md |
43 | | - copy ./README.md ./artifact/Regular/README.md |
44 | | - copy ./${{ env.BUILD_CONFIGURATION }}/CnCNet-Spawner.pdb ./artifact/Regular/CnCNet-Spawner.pdb |
45 | | - copy ./${{ env.BUILD_CONFIGURATION }}/CnCNet-Spawner.dll ./artifact/Regular/CnCNet-Spawner.dll |
46 | | - 7z a ${{ env.ARTIFACT_NAME }}.zip ./artifact/Regular/* |
47 | | - mkdir ./artifact/HardEnd |
48 | | - copy ./LICENSE.md ./artifact/HardEnd/LICENSE.md |
49 | | - copy ./README.md ./artifact/HardEnd/README.md |
50 | | - copy "./${{ env.BUILD_CONFIGURATION }}-HardEnd/CnCNet-Spawner.pdb" ./artifact/HardEnd/CnCNet-Spawner.pdb |
51 | | - copy "./${{ env.BUILD_CONFIGURATION }}-HardEnd/CnCNet-Spawner.dll" ./artifact/HardEnd/CnCNet-Spawner.dll |
52 | | - 7z a ${{ env.ARTIFACT_NAME }}-HardEnd.zip ./artifact/HardEnd/* |
| 32 | + - name: Create an Archive for the Release |
| 33 | + run: 7z a ${{ env.ARCHIVE_NAME }}.zip ./LICENSE.md ./${{ env.BUILD_CONFIG }}/CnCNet-Spawner.dll ./${{ env.BUILD_CONFIG }}/CnCNet-Spawner.pdb |
53 | 34 |
|
54 | | - - name: Upload New Release |
| 35 | + - name: Upload Files to the Release |
55 | 36 | uses: softprops/action-gh-release@v2 |
56 | 37 | with: |
57 | | - name: ${{ env.RELEASE_NAME }} |
58 | | - tag_name: ${{ env.RELEASE_NAME }} |
59 | | - body: ${{ env.RELEASE_NAME }} |
60 | 38 | append_body: true |
61 | | - draft: true |
62 | | - files: | |
63 | | - ${{ env.ARTIFACT_NAME }}.zip |
64 | | - ${{ env.ARTIFACT_NAME }}-HardEnd.zip |
| 39 | + files: ${{ env.ARCHIVE_NAME }} |
65 | 40 |
|
66 | | - request-anti-cheat-build: |
67 | | - needs: [build] |
68 | | - runs-on: ubuntu-latest |
69 | | - steps: |
70 | | - - name: Request AntiCheat Build |
71 | | - run: | |
72 | | - curl -L \ |
73 | | - -X POST \ |
74 | | - -H "Accept: application/vnd.github+json" \ |
75 | | - -H "Authorization: Bearer ${{ secrets.ACCESS_TOKEN }}" \ |
76 | | - -H "X-GitHub-Api-Version: 2022-11-28" \ |
77 | | - https://api.github.com/repos/cncnet/yrpp-spawner-private/actions/workflows/release-build-by-request.yml/dispatches \ |
78 | | - -d '{"ref":"main", "inputs":{"tag": "${{ github.ref_name }}"}}' |
0 commit comments