|
5 | 5 | push: |
6 | 6 | branches: |
7 | 7 | - master |
8 | | - - bluedove |
9 | 8 | - prerel |
| 9 | + workflow_call: |
| 10 | + inputs: |
| 11 | + build-mode: |
| 12 | + required: true |
| 13 | + type: string |
| 14 | + default: 'releasedbg' |
| 15 | + upload-build-for-next-job: |
| 16 | + required: true |
| 17 | + type: boolean |
| 18 | + default: false |
| 19 | + outputs: |
| 20 | + str-version: |
| 21 | + description: "Skyrim Together version string" |
| 22 | + value: ${{ jobs.build.outputs.version }} |
| 23 | + |
10 | 24 | jobs: |
11 | 25 | build: |
12 | 26 | strategy: |
13 | 27 | matrix: |
14 | 28 | os: [windows-latest] |
15 | 29 | arch: [x64] |
16 | | - mode: [releasedbg] |
17 | 30 |
|
18 | 31 | runs-on: ${{ matrix.os }} |
19 | 32 | if: "!contains(github.event.head_commit.message, 'ci skip')" |
20 | 33 |
|
| 34 | + outputs: |
| 35 | + version: ${{ steps.output-version.outputs.version }} |
| 36 | + |
21 | 37 | steps: |
22 | | - - uses: actions/checkout@v2 |
23 | | - |
24 | | - - name: Checkout submodules |
25 | | - run: | |
26 | | - git submodule sync --recursive |
27 | | - git submodule update --init --force --recursive --depth=1 |
28 | | - |
29 | | - # Install xmake |
30 | | - - name: Setup xmake |
31 | | - uses: xmake-io/github-action-setup-xmake@v1 |
32 | | - with: |
33 | | - xmake-version: '2.9.5' |
34 | | - |
35 | | - # Install node |
36 | | - #- name: Setup nodejs |
37 | | - # uses: actions/setup-node@v2 |
38 | | - # with: |
39 | | - # cache: npm |
40 | | - # node-version: 16 |
41 | | - |
42 | | - #- name: Update xmake repository |
43 | | - # run: xmake.exe repo --update |
44 | | - |
45 | | - #- name: Cache dependencies |
46 | | - # uses: actions/cache@v2 |
47 | | - # with: |
48 | | - # path: C:\Users\runneradmin\AppData\Local\.xmake\packages |
49 | | - # key: v2-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.mode }}-${{ hashFiles('xmake.lua') }}-${{ hashFiles('C:\Users\runneradmin\AppData\Local\.xmake\xmake.conf') }}-${{ hashFiles('C:\Users\runneradmin\AppData\Local\.xmake\repositories\**') }} |
50 | | - |
51 | | - #- name: Prepare npm |
52 | | - # run: npm install @semantic-release/github @semantic-release/exec conventional-changelog-conventionalcommits |
53 | | - |
54 | | - # Delete old releases |
55 | | - #- name: Remove old releases |
56 | | - # uses: dev-drprasad/[email protected] |
57 | | - # with: |
58 | | - # keep_latest: 1 |
59 | | - # delete_tags: true |
60 | | - # env: |
61 | | - # GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |
62 | | - |
63 | | - # Release version |
64 | | - #- name: Release version |
65 | | - # run: npx semantic-release |
66 | | - # env: |
67 | | - # GH_TOKEN: ${{ secrets.GH_TOKEN }} |
68 | | - |
69 | | - - name: Configure xmake and install dependencies |
70 | | - run: xmake.exe config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --yes --vs_sdkver=10.0.19041.0 -vD |
71 | | - |
72 | | - # Build the game |
73 | | - - name: Build with xmake |
74 | | - run: xmake.exe |
75 | | - |
76 | | - # Create install |
77 | | - #- name: Bundle package |
78 | | - # run: xmake.exe install -o packaged |
79 | | - |
80 | | - # Upload artifacts |
81 | | - #- uses: actions/upload-artifact@v2 |
82 | | - # with: |
83 | | - # name: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.mode }} |
84 | | - # path: packaged/bin/** |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + with: |
| 40 | + # We need full history in order to create a version string (BuildInfo.h) |
| 41 | + fetch-depth: 0 |
| 42 | + |
| 43 | + - name: Checkout submodules |
| 44 | + run: | |
| 45 | + git submodule sync --recursive |
| 46 | + git submodule update --init --force --recursive --depth=1 |
| 47 | +
|
| 48 | + - name: Checkout master on tag push |
| 49 | + if: github.ref_type == 'tag' |
| 50 | + # Checkout only if the tag was pushed to master |
| 51 | + run: (git rev-parse HEAD) -eq (git rev-parse origin/master) -and (git checkout master) |
| 52 | + |
| 53 | + - name: Cache xmake dependencies |
| 54 | + uses: actions/cache@v4 |
| 55 | + with: |
| 56 | + path: ~/AppData/Local/.xmake/packages |
| 57 | + key: ${{ runner.os }}-xmake-${{ hashFiles('**/xmake.lua') }} |
| 58 | + |
| 59 | + # Install xmake |
| 60 | + - name: Setup xmake |
| 61 | + uses: xmake-io/github-action-setup-xmake@v1 |
| 62 | + with: |
| 63 | + xmake-version: 2.9.8 |
| 64 | + actions-cache-folder: '.xmake-cache' # This doesn't cache dependencies, only xmake itself |
| 65 | + actions-cache-key: ${{ matrix.os }} |
| 66 | + |
| 67 | + - name: Configure xmake and install dependencies |
| 68 | + run: xmake config --arch=${{ matrix.arch }} --mode=${{ inputs.build-mode }} --yes -vD |
| 69 | + |
| 70 | + # Build the client |
| 71 | + - name: Build with xmake |
| 72 | + run: | |
| 73 | + xmake -y |
| 74 | + echo "STR_BUILD_DIR=build/windows/${{ matrix.arch }}/${{ inputs.build-mode }}/" >> $env:GITHUB_ENV |
| 75 | +
|
| 76 | + # Create distrib |
| 77 | + - name: Output distrib binaries via xmake |
| 78 | + run: | |
| 79 | + xmake install -o distrib |
| 80 | + cp -Force -Recurse distrib/bin/* ${{ env.STR_BUILD_DIR }} |
| 81 | +
|
| 82 | + # Building the Together UI |
| 83 | + |
| 84 | + - name: Setup pnpm |
| 85 | + uses: pnpm/action-setup@v4 |
| 86 | + with: |
| 87 | + version: 9 |
| 88 | + |
| 89 | + - name: Setup Node |
| 90 | + uses: actions/setup-node@v4 |
| 91 | + with: |
| 92 | + node-version: lts/iron |
| 93 | + cache-dependency-path: Code/skyrim_ui/pnpm-lock.yaml |
| 94 | + cache: 'pnpm' |
| 95 | + |
| 96 | + - name: Build the UI |
| 97 | + run: | |
| 98 | + pnpm --prefix Code/skyrim_ui/ install |
| 99 | + pnpm --prefix Code/skyrim_ui/ deploy:production |
| 100 | + cp -r Code/skyrim_ui/dist/UI ${{ env.STR_BUILD_DIR }} |
| 101 | +
|
| 102 | + - id: output-version |
| 103 | + run: echo "version=$(git describe --tags)" >> $env:GITHUB_OUTPUT |
| 104 | + |
| 105 | + - name: Upload build files for the next job |
| 106 | + if: ${{ inputs.upload-build-for-next-job }} |
| 107 | + uses: actions/upload-artifact@v4 |
| 108 | + with: |
| 109 | + name: internal-job-files |
| 110 | + retention-days: 1 |
| 111 | + path: | |
| 112 | + ${{ env.STR_BUILD_DIR }} |
| 113 | + GameFiles/Skyrim/ |
0 commit comments