mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-16 00:44:43 +00:00
Auto publish docs
This commit is contained in:
parent
67f6287a2b
commit
0429003863
7 changed files with 65 additions and 36 deletions
22
.github/workflows/docker.yaml
vendored
22
.github/workflows/docker.yaml
vendored
|
|
@ -1,22 +0,0 @@
|
||||||
name: Docker Image
|
|
||||||
on: [push]
|
|
||||||
jobs:
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Inject slug/short variables
|
|
||||||
uses: rlespinasse/github-slug-action@v2.x
|
|
||||||
- name: Set variables
|
|
||||||
run: |
|
|
||||||
echo "::set-env name=REPOSITORY::$(echo $GITHUB_REPOSITORY | tr '[A-Z]' '[a-z]')"
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@v1.1.0
|
|
||||||
with:
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ github.token }}
|
|
||||||
registry: docker.pkg.github.com
|
|
||||||
repository: ${{ env.REPOSITORY }}/server
|
|
||||||
tag_with_sha: true
|
|
||||||
tag_with_ref: true
|
|
||||||
48
.github/workflows/publish.yaml
vendored
Normal file
48
.github/workflows/publish.yaml
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
name: Publish
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
docs:
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Cache SBT
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.ivy2/cache
|
||||||
|
~/.sbt
|
||||||
|
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup Scala
|
||||||
|
uses: olafurpg/setup-scala@v5
|
||||||
|
- name: Build docs
|
||||||
|
run: sbt docs/unidoc
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
uses: JamesIves/github-pages-deploy-action@3.5.9
|
||||||
|
with:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
BRANCH: gh-pages
|
||||||
|
FOLDER: docs/target/scala-2.13/unidoc
|
||||||
|
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Inject slug/short variables
|
||||||
|
uses: rlespinasse/github-slug-action@v2.x
|
||||||
|
- name: Set variables
|
||||||
|
run: |
|
||||||
|
echo "::set-env name=REPOSITORY::$(echo $GITHUB_REPOSITORY | tr '[A-Z]' '[a-z]')"
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v1.1.0
|
||||||
|
with:
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ github.token }}
|
||||||
|
registry: docker.pkg.github.com
|
||||||
|
repository: ${{ env.REPOSITORY }}/server
|
||||||
|
tag_with_sha: true
|
||||||
|
tag_with_ref: true
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -11,6 +11,7 @@ out/
|
||||||
.bloop
|
.bloop
|
||||||
.metals
|
.metals
|
||||||
project/metals.sbt
|
project/metals.sbt
|
||||||
|
/docs
|
||||||
|
|
||||||
# User configs
|
# User configs
|
||||||
config/psforever.conf
|
config/psforever.conf
|
||||||
|
|
|
||||||
10
README.md
10
README.md
|
|
@ -112,14 +112,12 @@ To get started using pgAdmin, run the binary. This will start the pgAdmin server
|
||||||
with the interface. Upon first run, enter your connection details that you created during the PostgreSQL installation.
|
with the interface. Upon first run, enter your connection details that you created during the PostgreSQL installation.
|
||||||
When connected, right click the "Databases" menu -> Create... -> Database: psforever -> Save. Next, right click on the
|
When connected, right click the "Databases" menu -> Create... -> Database: psforever -> Save. Next, right click on the
|
||||||
newly created database (psforever) -> Query Tool... -> Copy and paste the commands below -> Hit the "Play/Run" button.
|
newly created database (psforever) -> Query Tool... -> Copy and paste the commands below -> Hit the "Play/Run" button.
|
||||||
The user should be created and granted the right permissions on all future objects.
|
The user should be created and made owner of the database.
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
CREATE USER psforever;
|
CREATE USER psforever;
|
||||||
ALTER USER psforever WITH PASSWORD 'psforever';
|
ALTER USER psforever WITH PASSWORD 'psforever';
|
||||||
ALTER DEFAULT PRIVILEGES IN SCHEMA PUBLIC GRANT ALL ON TABLES TO psforever;
|
ALTER TABLE psforever OWNER TO psforever;
|
||||||
ALTER DEFAULT PRIVILEGES IN SCHEMA PUBLIC GRANT ALL ON SEQUENCES TO psforever;
|
|
||||||
ALTER DEFAULT PRIVILEGES IN SCHEMA PUBLIC GRANT ALL ON FUNCTIONS TO psforever;
|
|
||||||
```
|
```
|
||||||
**NOTE:** applying default privileges _after_ importing the schema will not apply them to existing objects. To fix this,
|
**NOTE:** applying default privileges _after_ importing the schema will not apply them to existing objects. To fix this,
|
||||||
*you must drop all objects and try again or apply permissions manually using the Query Tool / `psql`.
|
*you must drop all objects and try again or apply permissions manually using the Query Tool / `psql`.
|
||||||
|
|
@ -194,9 +192,9 @@ some helper scripts. Run the correct file for your platform (.BAT for Windows an
|
||||||
|
|
||||||
### Generating Documentation
|
### Generating Documentation
|
||||||
|
|
||||||
Using sbt, you can generate documentation for both the common and pslogin projects using `sbt unidoc`.
|
Using sbt, you can generate documentation all projects using `sbt docs/unidoc`.
|
||||||
|
|
||||||
Current documentation is available at [https://psforever.github.io/docs/master/index.html](https://psforever.github.io/docs/master/index.html)
|
Current documentation is available at [https://jgillich.github.io/PSF-LoginServer/net/psforever/index.html](https://jgillich.github.io/PSF-LoginServer/net/psforever/index.html)
|
||||||
|
|
||||||
## Tools
|
## Tools
|
||||||
|
|
||||||
|
|
|
||||||
11
build.sbt
11
build.sbt
|
|
@ -27,13 +27,10 @@ lazy val psforeverSettings = Seq(
|
||||||
// scaladoc flags: https://github.com/scala/scala/blob/2.11.x/src/scaladoc/scala/tools/nsc/doc/Settings.scala
|
// scaladoc flags: https://github.com/scala/scala/blob/2.11.x/src/scaladoc/scala/tools/nsc/doc/Settings.scala
|
||||||
scalacOptions in (Compile, doc) ++= Seq(
|
scalacOptions in (Compile, doc) ++= Seq(
|
||||||
"-groups",
|
"-groups",
|
||||||
"-implicits",
|
|
||||||
"-doc-title",
|
"-doc-title",
|
||||||
"PSF-LoginServer - ",
|
"PSF-LoginServer - ",
|
||||||
"-doc-version",
|
"-doc-version",
|
||||||
"master",
|
"master",
|
||||||
"-doc-footer",
|
|
||||||
"Copyright PSForever",
|
|
||||||
// For non unidoc builds, you may need bd.getName before the template parameter
|
// For non unidoc builds, you may need bd.getName before the template parameter
|
||||||
"-doc-source-url",
|
"-doc-source-url",
|
||||||
"https://github.com/psforever/PSF-LoginServer/blob/master/€{FILE_PATH}.scala",
|
"https://github.com/psforever/PSF-LoginServer/blob/master/€{FILE_PATH}.scala",
|
||||||
|
|
@ -134,3 +131,11 @@ lazy val decodePackets = (project in file("tools/decode-packets"))
|
||||||
|
|
||||||
// Special test configuration for really quiet tests (used in CI)
|
// Special test configuration for really quiet tests (used in CI)
|
||||||
lazy val QuietTest = config("quiet") extend Test
|
lazy val QuietTest = config("quiet") extend Test
|
||||||
|
|
||||||
|
lazy val docs = (project in file("docs"))
|
||||||
|
.settings(psforeverSettings: _*)
|
||||||
|
.enablePlugins(ScalaUnidocPlugin)
|
||||||
|
.settings(
|
||||||
|
name := "psforever"
|
||||||
|
)
|
||||||
|
.aggregate(psforever, server, decodePackets)
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@ admin {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Database configuration
|
# Database configuration
|
||||||
|
# Full reference: https://github.com/jasync-sql/jasync-sql/wiki/Configuring-and-Managing-Connections
|
||||||
|
# https://github.com/getquill/quill/blob/master/quill-jasync/src/main/scala/io/getquill/context/jasync/JAsyncContextConfig.scala
|
||||||
database {
|
database {
|
||||||
# The hostname of the PostgreSQL server.
|
# The hostname of the PostgreSQL server.
|
||||||
host = localhost
|
host = localhost
|
||||||
|
|
|
||||||
|
|
@ -49,11 +49,8 @@ case object Cosmetic extends IntEnum[Cosmetic] {
|
||||||
*/
|
*/
|
||||||
def valuesToAttributeValue(values: Set[Cosmetic]): Long = {
|
def valuesToAttributeValue(values: Set[Cosmetic]): Long = {
|
||||||
values.foldLeft(1) {
|
values.foldLeft(1) {
|
||||||
case (sum, NoHelmet) => sum - 1
|
case (sum, NoHelmet) => sum - NoHelmet.value
|
||||||
case (sum, BrimmedCap) => sum + 2
|
case (sum, entry) => sum + entry.value
|
||||||
case (sum, Sunglasses) => sum + 4
|
|
||||||
case (sum, Earpiece) => sum + 8
|
|
||||||
case (sum, Beret) => sum + 16
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue