Skip to content

Commit

Permalink
feat: January 9th Alpha Updates (#1070)
Browse files Browse the repository at this point in the history
Some small fixes and deployment improvements.

I was going to push several big database changes with this release (more
website features), but it's best suited for the next one - some
migration scripts have to be ran at the same time.

## Content Changes

### Fixes

* #1062
* #1068

## Engine Changes

### Features

* `::broadcast` command for admins

### Fixes

* Increased default reboot timer to from 30s to 5 mins - longer grace
period for users to finish up and get somewhere safe
  * Deployments take less than a minute!
* Flipped shutdown protection check
  • Loading branch information
Pazaz authored Jan 9, 2025
2 parents 0058e14 + 38a4fba commit ef6b229
Show file tree
Hide file tree
Showing 19 changed files with 6,043 additions and 280 deletions.
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
name: Pack Content
name: Verify Content

on:
pull_request:
branches: [ main ]
push:
branches: [ main, live ]
paths:
- '.github/workflows/content-pack.yml'
- '.github/workflows/content.yml'
- 'data/src/**'
workflow_dispatch:

jobs:
build:
pack:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: false

- uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'pnpm'

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Install Dependencies
run: |
npm i
wget https://github.com/2004scape/RuneScriptCompiler/releases/latest/download/RuneScriptCompiler.jar
- run: pnpm i

- name: Validate and Build Cache
- name: Pack
run: npm run build
70 changes: 0 additions & 70 deletions .github/workflows/deploy-worlds.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/engine-compile.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/engine-lint.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/engine-test.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/engine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Verify Engine Code

on:
pull_request:
push:
paths:
- '.github/workflows/engine.yml'
- 'src/**'
- 'tools/**'
workflow_dispatch:

jobs:
verify:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: false

- uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'pnpm'

- run: pnpm i

- name: Lint
run: npm run lint

- name: Compile
run: npx tsx

- name: Test
run: npm test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PR title should be conventional commit format
name: PR title should be in conventional commit format

on:
pull_request_target:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/worlds-content.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Pack Content

on:
workflow_call:

jobs:
pack:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: false

- uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'pnpm'

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- run: pnpm i

- name: Pack
run: npm run build

- name: Upload Packed Data
uses: actions/upload-artifact@v4
with:
name: packed
path: data/pack
retention-days: 1
62 changes: 62 additions & 0 deletions .github/workflows/worlds-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy World
env: ${{ secrets }}

on:
workflow_call:
inputs:
environment:
required: true
type: string

# pm2 start npm --name "w1-maintenance" -- run maintenance
# pm2 start npm --name "w2-maintenance" -- run maintenance
# pm2 start npm --name "w1-server" --kill-timeout 600000 -- run quickstart
# pm2 start npm --name "w2-server" --kill-timeout 600000 -- run quickstart

jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.environment}}

steps:
- name: Download Packed Data
uses: actions/download-artifact@v4
with:
name: packed

- name: Shutdown World
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
port: ${{ secrets.PORT }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: |
source ~/.bashrc
cd ${{ secrets.DIR }}
git pull
pnpm i
pm2 stop ${{ secrets.PROCESS }}
pm2 start ${{ secrets.MAINT_PROCESS }}
- name: Update Content
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
port: ${{ secrets.PORT }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
source: "client,server"
target: ${{ secrets.DIR }}/data/pack
rm: true

- name: Start World
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
port: ${{ secrets.PORT }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: |
pm2 stop ${{ secrets.MAINT_PROCESS }}
pm2 start ${{ secrets.PROCESS }}
23 changes: 23 additions & 0 deletions .github/workflows/worlds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Deploy All Worlds

on:
workflow_dispatch:

concurrency:
group: worlds
cancel-in-progress: true

jobs:
content:
uses: ./.github/workflows/worlds-content.yml

worlds:
strategy:
fail-fast: false
matrix:
environment: [world1, world2]
needs: [content]
uses: ./.github/workflows/worlds-deploy.yml
with:
environment: ${{ matrix.environment }}
secrets: inherit
Loading

0 comments on commit ef6b229

Please sign in to comment.