|
| 1 | +name: Playable Skyrim Together Build |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + # Every Friday at 1:00 p.m. UTC |
| 7 | + - cron: '0 13 * * 5' |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - master |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + os: [windows-latest] |
| 17 | + arch: [x64] |
| 18 | + mode: [release] |
| 19 | + |
| 20 | + runs-on: ${{ matrix.os }} |
| 21 | + |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + with: |
| 25 | + # We need full history in order to create a build version string (BuildInfo.h) |
| 26 | + fetch-depth: 0 |
| 27 | + |
| 28 | + - name: Checkout submodules |
| 29 | + run: | |
| 30 | + git submodule sync --recursive |
| 31 | + git submodule update --init --force --recursive --depth=1 |
| 32 | +
|
| 33 | + # Install xmake |
| 34 | + - name: Setup xmake |
| 35 | + uses: xmake-io/github-action-setup-xmake@v1 |
| 36 | + with: |
| 37 | + xmake-version: 2.9.5 |
| 38 | + |
| 39 | + - name: Configure xmake and install dependencies |
| 40 | + run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --yes -vD |
| 41 | + |
| 42 | + # Build the game |
| 43 | + - name: Build with xmake |
| 44 | + run: xmake -y |
| 45 | + |
| 46 | + # Create distrib |
| 47 | + - name: Output STR binaries via xmake |
| 48 | + run: xmake install -o distrib |
| 49 | + |
| 50 | + # Building the Together UI |
| 51 | + - name: Setup pnpm |
| 52 | + uses: pnpm/action-setup@v4 |
| 53 | + with: |
| 54 | + version: 9 |
| 55 | + |
| 56 | + - name: Setup Node |
| 57 | + uses: actions/setup-node@v4 |
| 58 | + with: |
| 59 | + node-version: lts/iron |
| 60 | + cache-dependency-path: Code/skyrim_ui/pnpm-lock.yaml |
| 61 | + cache: 'pnpm' |
| 62 | + |
| 63 | + - name: Build the UI |
| 64 | + run: | |
| 65 | + pnpm --prefix Code/skyrim_ui/ install |
| 66 | + pnpm --prefix Code/skyrim_ui/ deploy:production |
| 67 | +
|
| 68 | + # Package everything, organize directories |
| 69 | + |
| 70 | + - name: Package binaries and assets |
| 71 | + run: | |
| 72 | + mkdir -p str-build/SkyrimTogetherReborn |
| 73 | + mv build/windows/${{ matrix.arch }}/${{ matrix.mode }}/* str-build/SkyrimTogetherReborn |
| 74 | + cp -Force -Recurse distrib/bin/* str-build/SkyrimTogetherReborn |
| 75 | + cp -r Code/skyrim_ui/dist/UI str-build/SkyrimTogetherReborn |
| 76 | + cp -r GameFiles/Skyrim/* str-build/ |
| 77 | +
|
| 78 | + - name: Remove unnecessary build files |
| 79 | + run: rm str-build/SkyrimTogetherReborn/*.pdb, str-build/SkyrimTogetherReborn/*.lib |
| 80 | + |
| 81 | + # Upload artifact |
| 82 | + |
| 83 | + - name: Store short commit hash |
| 84 | + run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 8))" >> $env:GITHUB_ENV |
| 85 | + |
| 86 | + - name: Upload playable build |
| 87 | + uses: actions/upload-artifact@v4 |
| 88 | + with: |
| 89 | + name: Skyrim Together Build (${{ env.SHORT_SHA }}) |
| 90 | + path: str-build/ |
0 commit comments