|
6 | 6 | branches: |
7 | 7 | - '**' |
8 | 8 |
|
9 | | -env: |
10 | | - GEODE_SDK: ${{ github.workspace }}/sdk |
11 | | - GEODE_VERSION: nightly |
12 | | - CLI_VERSION: v2.2.2 |
13 | | - MOD_NAME: DevTools |
14 | | - MOD_ID: geode.devtools |
15 | | - |
16 | 9 | jobs: |
17 | 10 | build: |
18 | 11 | strategy: |
19 | 12 | fail-fast: false |
20 | 13 | matrix: |
21 | 14 | config: |
22 | | - - name: "Windows" |
23 | | - bin_folder: "windows" |
24 | | - os: windows-2019 |
25 | | - extra_flags: '-T host=x64 -A win32' |
26 | | - out_paths: './build/Release/*.dll' |
27 | | - platform_suffix: 'win' |
| 15 | + - name: Windows |
| 16 | + os: windows-latest |
28 | 17 |
|
29 | | - - name: "macOS" |
30 | | - bin_folder: "macos" |
| 18 | + - name: macOS |
31 | 19 | os: macos-latest |
32 | | - extra_flags: "" |
33 | | - out_paths: './build/*.dylib' |
34 | | - platform_suffix: 'mac' |
35 | | - |
| 20 | + |
36 | 21 | name: ${{ matrix.config.name }} |
37 | 22 | runs-on: ${{ matrix.config.os }} |
38 | 23 |
|
39 | 24 | steps: |
40 | | - - uses: actions/checkout@v3 |
41 | | - with: |
42 | | - submodules: recursive |
| 25 | + - uses: actions/checkout@v3 |
43 | 26 |
|
44 | | - - uses: actions/checkout@v3 |
45 | | - with: |
46 | | - submodules: recursive |
47 | | - repository: geode-sdk/geode |
48 | | - # ref: v0.4.8 |
49 | | - path: ${{ env.GEODE_SDK }} |
50 | | - |
51 | | - - uses: ilammy/msvc-dev-cmd@v1 |
52 | | - with: |
53 | | - arch: x86 |
| 27 | + - name: Build the mod |
| 28 | + uses: geode-sdk/build-geode-mod@main |
| 29 | + with: |
| 30 | + combine: true |
54 | 31 |
|
55 | | - - name: Download Geode SDK binaries |
56 | | - run: | |
57 | | - cd ${{ github.workspace }}/sdk |
58 | | - mkdir bin |
59 | | - mkdir bin/nightly |
60 | | - cd bin/nightly |
61 | | - curl -L https://github.com/geode-sdk/geode/releases/download/${{ env.GEODE_VERSION }}/geode-${{ env.GEODE_VERSION }}-${{ matrix.config.platform_suffix }}.zip -o geode-sdk.zip |
62 | | - tar -xf geode-sdk.zip |
63 | | -
|
64 | | - - name: Configure CMake |
65 | | - run: | |
66 | | - cd ${{ github.workspace }} |
67 | | - cmake -B build ${{ matrix.config.extra_flags }} -DGEODE_DISABLE_CLI_CALLS=1 |
68 | | - |
69 | | - - name: Build |
70 | | - run: | |
71 | | - cd ${{ github.workspace }}/build |
72 | | - cmake --build . --config Release |
73 | | - |
74 | | - - uses: actions/upload-artifact@v3 |
75 | | - with: |
76 | | - name: "build-${{ matrix.config.bin_folder }}" |
77 | | - path: "${{ matrix.config.out_paths }}" |
78 | | - |
79 | | - |
80 | 32 | package: |
81 | | - name: "Package both builds" |
82 | | - # would use linux but theres no cli build for it |
83 | | - runs-on: windows-2019 |
| 33 | + name: Package builds |
| 34 | + runs-on: ubuntu-latest |
84 | 35 | needs: ['build'] |
85 | | - |
86 | | - steps: |
87 | | - - uses: actions/checkout@v3 |
88 | | - with: |
89 | | - submodules: recursive |
90 | | - |
91 | | - - name: Download and Unzip CLI |
92 | | - run: | |
93 | | - curl -L https://github.com/geode-sdk/cli/releases/download/${{ env.CLI_VERSION }}/geode-cli-${{ env.CLI_VERSION }}-win.zip -o geode-cli.zip |
94 | | - tar -xf geode-cli.zip |
95 | 36 |
|
96 | | - - uses: actions/download-artifact@v3 |
97 | | - with: |
98 | | - name: build-windows |
99 | | - |
100 | | - - uses: actions/download-artifact@v3 |
101 | | - with: |
102 | | - name: build-macos |
103 | | - |
104 | | - - name: Merge |
105 | | - shell: bash |
106 | | - run: | |
107 | | - mv $MOD_NAME.dll $MOD_ID.dll |
108 | | - mv lib$MOD_NAME.dylib $MOD_ID.dylib |
109 | | - ./geode.exe package new . --binary $MOD_ID.dll --binary $MOD_ID.dylib --output $MOD_ID.geode |
110 | | - |
| 37 | + steps: |
| 38 | + - uses: geode-sdk/build-geode-mod@combine |
| 39 | + id: build |
| 40 | + |
111 | 41 | - uses: actions/upload-artifact@v3 |
112 | 42 | with: |
113 | 43 | name: Build Output |
114 | | - path: "${{ env.MOD_ID }}.geode" |
115 | | - |
116 | | - - uses: geekyeggo/delete-artifact@v2 |
117 | | - with: |
118 | | - name: build-windows |
119 | | - failOnError: false |
120 | | - |
121 | | - - uses: geekyeggo/delete-artifact@v2 |
122 | | - with: |
123 | | - name: build-macos |
124 | | - failOnError: false |
| 44 | + path: ${{ steps.build.outputs.build-output }} |
0 commit comments