Skip to content

Commit

Permalink
Merge pull request #310 from Kaetram/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
Veradictus authored Sep 29, 2023
2 parents 45546ed + a1008a1 commit 29a6e9d
Show file tree
Hide file tree
Showing 1,912 changed files with 145,839 additions and 32,583 deletions.
17 changes: 14 additions & 3 deletions .env.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SSL=false

# API Configuration
API_ENABLED=false
API_PORT=9003
API_PORT=9002

# Server ID (increment with each server hosted)
SERVER_ID=1
Expand All @@ -35,6 +35,10 @@ REMOTE_API_HOST=''
# connections are limited to only trusted clients and APIs.
HUB_ACCESS_TOKEN=''

# Defaults to `HUB_HOST` if empty
ADMIN_HOST=''
ADMIN_PORT=9528

# Overrides where the client connects to
# Defaults to `HOST` for the client if empty
CLIENT_REMOTE_HOST=''
Expand Down Expand Up @@ -72,13 +76,13 @@ AGGREGATE_THRESHOLD=60000
TUTORIAL_ENABLED=true
# !! Allows login with any credentials !!
OVERWRITE_AUTH=false
DEVELOPMENT=false
DISABLE_REGISTER=false
# Maximum number of players allowed on the server.
MAX_PLAYERS=200
# Update time to parse packets in milliseconds (update every 300ms)
UPDATE_TIME=300
# Game version
GVER='0.1.0-beta'
GVER='0.5.5-beta'
# Used for hotfixes and minor updates that do not require a full update.
MINOR=''
# If to load regions from cache.
Expand Down Expand Up @@ -117,6 +121,13 @@ DISCORD_CHANNEL_ID=``
# The bot token used to interact with the server.
DISCORD_BOT_TOKEN=''

# === LICENSING ===
# By using this project, you agree to the terms and conditions outlined in the MPL2.0 and OPL license.
# These licenses can be found in the LICENSE and LICENSE_OPL files respectively.
# Toggling the following indicates that you have read and agree to all the terms and conditions outlined in the licenses.
# Any form of bypassing/altering of the license agreement form indicates you agree to the terms and conditions outlined in the licenses.
ACCEPT_LICENSE=false

# === Debugging ===

# Will print out more debugging info from log
Expand Down
2 changes: 2 additions & 0 deletions .env.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ HOST='0.0.0.0'
SKIP_DATABASE=false

MONGODB_DATABASE='kaetram_e2e'

ACCEPT_LICENSE=true
8 changes: 6 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:unicorn/recommended",
"plugin:prettier/recommended"
"plugin:prettier/recommended",
"plugin:astro/recommended",
"plugin:astro/jsx-a11y-strict"
],
"plugins": ["prefer-let"],
"parserOptions": {
"project": "tsconfig.json"
},
"plugins": ["prefer-let"],
"rules": {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-dynamic-delete": "off",
Expand Down Expand Up @@ -55,6 +57,7 @@
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],

"import/no-unresolved": "off",
"import/no-named-as-default-member": "off",
"import/order": [
"warn",
{
Expand All @@ -81,6 +84,7 @@
"unicorn/no-array-reduce": "off",
"unicorn/prefer-number-properties": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/prefer-math-trunc": "off",

// TODO: Enable on ES2022
"unicorn/prefer-string-replace-all": "off",
Expand Down
120 changes: 120 additions & 0 deletions .github/workflows/app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Build App Artifacts

on: workflow_dispatch

jobs:
build-android:
defaults:
run:
shell: bash

strategy:
matrix:
node-version: [20.x]

name: Build android artifacts

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Update Submodule
run: git submodule update --init --recursive

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Enable Corepack
run: corepack enable

- name: Cache node_modules
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-node-${{ matrix.node-version }}
- name: Get Yarn cache directory
id: yarn-cache
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: Cache Yarn folder
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-${{ matrix.node-version }}
- name: Cache Yarn install state
uses: actions/cache@v3
with:
path: ./.yarn/install-state.gz
key: ${{ runner.os }}-yarn-install-state-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-install-state-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-install-state-${{ matrix.node-version }}
- name: Install Dependencies
run: yarn install

- name: Install Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
architecture: x64
cache: gradle

- name: Install Android SDK Tools
run: |
echo y | $ANDROID_HOME/tools/bin/sdkmanager --sdk_root=$ANDROID_HOME --install 'platform-tools' 'build-tools;30.0.3' 'platforms;android-30' 'ndk;25.0.8775105'
echo NDK_HOME=$ANDROID_HOME/ndk/25.0.8775105 >> $GITHUB_ENV
- name: Cache rustup
uses: actions/cache@v3
with:
path: ~/.rustup
key: ${{ runner.os }}-rustup

- name: Install Rust Toolchain
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal --target x86_64-unknown-linux-gnu aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
- name: Cache Rust project
uses: Swatinem/rust-cache@v2
with:
workspaces: ./pacakges/app

- name: Install Prererequisites
run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev

- name: Install Tauri
run: cargo install tauri-cli --version '^2.0.0-alpha.10'

- name: Initialize Android Build
run: cargo tauri android init

- name: Write Key and Local Properties
run: |
echo '${{ secrets.ANDROID_KEY }}' | base64 --decode > ./packages/app/gen/android/app/key.jks
echo '${{ secrets.ANDROID_LOCAL_PROPERTIES }}' > ./packages/app/gen/android/local.properties
- name: Build Android App
run: cargo tauri android build

- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: android-artifacts
path: |
./packages/app/gen/android/app/build/outputs/apk/**/*.apk
./packages/app/gen/android/app/build/outputs/bundle/**/*.aab
40 changes: 37 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Kaetram-Open CI
name: Continuous Integration

on: [push, pull_request]

jobs:
build:
defaults:
run:
shell: bash

strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [16.x, 18.x]
node-version: [18.x, 20.x]
os: [ubuntu-latest, windows-latest, macos-latest]

name: Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
Expand All @@ -25,11 +29,41 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Enable Corepack
run: corepack enable

- name: Cache node_modules
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-node-${{ matrix.node-version }}
- name: Get Yarn cache directory
id: yarn-cache
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: Cache Yarn folder
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-${{ matrix.node-version }}
- name: Cache Yarn install state
uses: actions/cache@v3
with:
path: ./.yarn/install-state.gz
key: ${{ runner.os }}-yarn-install-state-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-install-state-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-install-state-${{ matrix.node-version }}
- name: Install Dependencies
run: yarn install

Expand Down
50 changes: 45 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ on: [push, pull_request]

jobs:
test:
defaults:
run:
shell: bash

strategy:
matrix:
node-version: [18.x]

name: Run tests

runs-on: ubuntu-latest
Expand All @@ -15,19 +23,51 @@ jobs:
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.7.0

- name: Setup Node
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.5.0
cache: 'yarn'
node-version: ${{ matrix.node-version }}

- name: Enable Corepack
run: corepack enable

- name: Cache node_modules
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-node-${{ matrix.node-version }}
- name: Get Yarn cache directory
id: yarn-cache
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: Cache Yarn folder
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-${{ matrix.node-version }}
- name: Cache Yarn install state
uses: actions/cache@v3
with:
path: ./.yarn/install-state.gz
key: ${{ runner.os }}-yarn-install-state-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-install-state-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-install-state-${{ matrix.node-version }}
- name: Run Cypress
uses: cypress-io/github-action@v4
uses: cypress-io/github-action@v5
with:
command: yarn workspace @kaetram/e2e test:record
working-directory: ./packages/e2e
install-command: yarn install
command: yarn test:record
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 10 additions & 5 deletions .github/workflows/deploy.yml → .github/workflows/server.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
name: Kaetram
name: Deploy to Development Server

on:
push:
branches: [game-content, beta]

jobs:
build:
deploy:
defaults:
run:
shell: bash

runs-on: ubuntu-latest

environment: development

steps:
- name: Deploy to the development server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEV_SERVER_HOST }}
port: 22
username: ${{ secrets.DEV_SERVER_USERNAME }}
key: ${{ secrets.DEV_SERVER_KEY }}
port: 22
script: |
${{ secrets.DEV_SERVER_SCRIPT }}
script: ${{ secrets.DEV_SERVER_SCRIPT }}
Loading

0 comments on commit 29a6e9d

Please sign in to comment.