Skip to content

Commit

Permalink
Merge pull request #40 from averak/release/v0.1.0
Browse files Browse the repository at this point in the history
Release/v0.1.0
  • Loading branch information
averak authored Jan 9, 2024
2 parents 1e14d05 + f241be5 commit 1cd2ce9
Show file tree
Hide file tree
Showing 76 changed files with 4,606 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*]
charset = utf-8
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 140

[*.{kt,kts}]
ktlint_code_style = intellij_idea
ktlint_standard_no-wildcard-imports = disabled
ktlint_standard_package-name = disabled
ktlint_standard_max-line-length = disabled

[*.md]
max_line_length = off
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI

on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: corretto
java-version: 17
cache: gradle
- uses: google-github-actions/setup-gcloud@v1

- name: cache sonar packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: launch docker
run: |
docker-compose up -d
- name: backend test
run: |
./gradlew test jacocoTestReport
- name: backend analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
./gradlew sonar
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: corretto
java-version: 17
cache: gradle

- name: backend lint
run: |
./gradlew spotlessCheck
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: build docker image
uses: docker/build-push-action@v3
with:
context: .
push: false
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Gradle
.gradle/
build/

# Eclipse
.project
.classpath
.settings/
bin/

# IntelliJ
.idea
*.ipr
*.iml
*.iws

# NetBeans
nb-configuration.xml

# Visual Studio Code
.vscode
.factorypath

# OSX
.DS_Store

# Vim
*.swp
*.swo

# patch
*.orig
*.rej
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM public.ecr.aws/docker/library/amazoncorretto:17 as build-stage

WORKDIR /app
COPY . /app/

RUN yum install -y git
RUN ./gradlew build -x test

FROM public.ecr.aws/docker/library/amazoncorretto:17

COPY --from=build-stage /app/build/libs/*.jar app.jar
ENTRYPOINT ["java","-jar","app.jar"]
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.PHONY: build
build:
./gradlew build -x test

.PHONY: test
test:
./gradlew test jacocoTestReport

.PHONY: lint
lint:
./gradlew spotlessCheck

.PHONY: format
format:
./gradlew spotlessApply

.PHONY: codegen
codegen:
./gradlew mbGenerate
./gradlew spotlessApply

.PHONY: db-migrate
db-migrate:
./gradlew flywayMigrate

.PHONY: db-clean
db-clean:
./gradlew flywayClean

.PHONY: check_dependencies
check_dependencies:
./gradlew dependencyUpdates -Drevision=release

.PHONY: update_dependencies
update_dependencies:
./gradlew versionCatalogUpdate
61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# gsync

![CI](https://github.com/averak/gsync/workflows/CI/badge.svg)

This is a multi-tenancy game server for MO games.

This component provides only reusable features that can be used across various games, and individual logic cannot be embedded.

## Features

* Player authentication / authorization
* Friend
* Match making
* Realtime messaging
* And more

## Develop

This document only contains minimal setup instructions to launch the application.

For more information, see [Makefile](./Makefile).

### Environments

* Java OpenJDK 17
* Kotlin 1.9
* Spring Boot 3.2
* Cloud Spanner
* Redis

### Running the application in dev mode

You can run your application in dev mode.

```shell
docker compose up -d
./gradlew bootRun
```

### Packaging and running the application

The application can be packaged.

```shell
make build
```

It produces the `gsync.jar` file in the `build/libs/` directory.

The application is now runnable using `java -jar build/libs/gsync.jar`.

### Check Dependency updates

Follow steps [littlerobots/version-catalog-update-plugin](https://github.com/littlerobots/version-catalog-update-plugin?tab=readme-ov-file#interactive-mode) to update outdated dependencies.

```shell
./gradlew versionCatalogUpdate --interactive

# Check the execution plan automatically generated in `gradle/libs.version.updates.toml` and apply if there is no problem.
./gradlew versionCatalogApplyUpdates
```
Loading

0 comments on commit 1cd2ce9

Please sign in to comment.