Skip to content

Commit

Permalink
Merge branch 'main' into legends-quest
Browse files Browse the repository at this point in the history
  • Loading branch information
noted-shark committed Jan 16, 2025
2 parents 07758ea + 6b5c579 commit 7561a84
Show file tree
Hide file tree
Showing 1,069 changed files with 21,165 additions and 168,086 deletions.
10 changes: 9 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,27 @@
# NODE_ALLOW_CHEATS=true
# NODE_DEBUG=true
# NODE_DEBUG_PROFILE=false
# NODE_DEBUG_SOCKET=false
# NODE_STAFF=pazaz
# NODE_CLIENT_ROUTEFINDER=true
# NODE_SOCKET_TIMEOUT=true
# NODE_WALKTRIGGER_SETTING=0

## login server
# LOGIN_SERVER=false
# LOGIN_HOST=localhost
# LOGIN_PORT=43500
# LOGIN_KEY=

## friend server
# FRIEND_SERVER=false
# FRIEND_HOST=localhost
# FRIEND_PORT=45099

## logger server
# LOGGER_SERVER=false
# LOGGER_HOST=localhost
# LOGGER_PORT=43501

## database
# DATABASE_URL=mysql://root:password@localhost:3306/lostcity
# DB_HOST=localhost
Expand Down
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 }}
Loading

0 comments on commit 7561a84

Please sign in to comment.