-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from averak/release/v0.1.0
Release/v0.1.0
- Loading branch information
Showing
76 changed files
with
4,606 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
Oops, something went wrong.