Skip to content

Commit

Permalink
Set up automated CI for outputting weekly builds
Browse files Browse the repository at this point in the history
  • Loading branch information
miredirex committed Nov 17, 2024
1 parent f0418fc commit 0d8f7fa
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/playable-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Playable Skyrim Together Build

on:
workflow_dispatch:
schedule:
# Every Friday at 1:00 p.m. UTC
- cron: '0 13 * * 5'
push:
branches:
- master

jobs:
build:
strategy:
matrix:
os: [windows-latest]
arch: [x64]
mode: [release]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Checkout submodules
run: |
git submodule sync --recursive
git submodule update --init --force --recursive --depth=1
# Install xmake
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: '2.9.5'

- name: Configure xmake and install dependencies
run: xmake.exe config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --yes -vD

# Build the game
- name: Build with xmake
run: xmake.exe

# Create distrib
- name: Output STR binaries via xmake
run: xmake.exe install -o distrib

# Building the Together UI (TODO: move into its own job?)

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/iron
cache-dependency-path: Code/skyrim_ui/pnpm-lock.yaml
cache: 'pnpm'

- name: Build the UI
run: |
pnpm --prefix Code/skyrim_ui/ install
pnpm --prefix Code/skyrim_ui/ deploy:production
# Package everything, organize directories

- name: Package binaries and assets
run: |
mkdir -p str-build/SkyrimTogetherReborn
mv build/windows/${{ matrix.arch }}/${{ matrix.mode }}/* str-build/SkyrimTogetherReborn
cp -Force -Recurse distrib/bin/* str-build/SkyrimTogetherReborn
cp -r Code/skyrim_ui/dist/UI str-build/SkyrimTogetherReborn
cp -r GameFiles/Skyrim/* str-build/
- name: Remove unnecessary build files
run: rm str-build/SkyrimTogetherReborn/*.pdb, str-build/SkyrimTogetherReborn/*.lib

# Upload artifact

- name: Store short commit hash
run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 8))" >> $env:GITHUB_ENV

- name: Upload playable build
uses: actions/upload-artifact@v4
with:
name: Skyrim Together Build ${{ env.SHORT_SHA }}
path: str-build/

0 comments on commit 0d8f7fa

Please sign in to comment.