Skip to content

Commit

Permalink
Merge pull request #209 from charles-m-knox/github-actions-repo-cleanup
Browse files Browse the repository at this point in the history
Repo cleanup after GitHub Actions implementation
  • Loading branch information
Promises authored Sep 7, 2024
2 parents df3181b + 22931b1 commit 0c80ff2
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 32 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ artifacts/
.DS_Store
.classpath
.project
.settings/org.eclipse.jdt.core.prefs
.settings/org.eclipse.jdt.core.prefs

# as of 2024-09-04, prebuilt dir is deprecated in favor of releases due to
# increasing binary blob file sizes
/prebuilt
96 changes: 65 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,22 @@
# RuneJS Java Client #435

A RuneScape game client from October 2006 which has been modified to work with RuneJS, a RuneScape game server written in NodeJS and TypeScript. **This client is not for OldSchool RuneScape** - client #435 pre-dates the very first OSRS client by quite some time.
A RuneScape game client from October 2006 which has been modified to work with RuneJS, a RuneScape game server written in NodeJS and TypeScript. **This client is not for OldSchool RuneScape** - client #435 pre-dates the very first OSRS client by quite some time.

We've no interest in OSRS client hacking, this client exists as a means to develop on RuneJS game servers and will not work with other server emulators.

## Usage

Running the client can be done either with the pre-built client JAR file or by building the Java code and running it manually in an IDE.
Running the client can be done either with the pre-built client `.jar` file from this repository's [releases](https://github.com/runejs/refactored-client-435/releases) page, or by building the Java code and running it manually in an IDE.

### Pre-Built Client

Running the pre-built client requires having Java installed: https://www.java.com/en/
Running the pre-built client requires having Java installed: <https://www.java.com/en/>

Once installed, go into the `/prebuilt/` and simply double-click the JAR file to run it. Alternatively if executing the JAR does not work, the command `java -jar client-435-0.3.jar` may be used from within the `/prebuilt/` directory.
Once installed, go to the [releases](https://github.com/runejs/refactored-client-435/releases) page, download the latest release, and simply double-click the `.jar` file file to run it. Alternatively if executing the `.jar` file does not work, the command `java -jar client-435-0.3.jar` can be used.

The client will use a set of default configurations if no file is provided. The default client configuration matches up to the default RuneJS server configuration for quick and easy initial setup. It's highly advised that you generate your own RSA public and private keys for long term use.

To provide your own configurations, create a file named `client-435.conf.yaml` in your User Home directory with the following content:

```yaml
net:
address: 127.0.0.1
game_port: 43594
cache:
cacheDir: .filestore_435
rsa:
rsaPub: YOUR_RSA_PUBLIC_KEY (default dev pair provided in the example file)
rsaModulus: YOUR_RSA_PRIVATE_KEY (default dev pair provided in the example file)
login:
useStaticCredentials: true
username: a
password: a
game:
roofsEnabled: true
freeTeleports: false
debugContextMenu: true
serverDisplayName: Build 435
```
Make sure to modify the given configuration for your specific needs.
To provide your own configurations, copy the file [`./config/client-435.conf.example.yml`](./config/client-435.conf.example.yaml) to `client-435.conf.yaml` in your user's home directory, and modify the given configuration for your specific needs.

### Gradle

Expand All @@ -47,20 +25,76 @@ without the help of an IDE such as IntelliJ. Gradle is also configured to automa

The following examples use the unix executable `./gradlew`, however Windows can replace these with `./gradlew.bat`.

**Running via Gradle**
#### Running via Gradle

The `application` gradle plugin provides the `run` task, which starts up the Main client class. With this option,
arguments can be provided via `--args`.

```
```bash
./gradlew run
```

**Building a Jar**
#### Building a `.jar` file

The `jar` task can be used to build a jar, which is generated in the `build/libs` directory.

```
```bash
./gradlew jar
java -jar ./build/libs/client-435-0.3.jar
```

#### Gradle and Java versions

As of 2024-09-04, our manual builds are done with the following Gradle and Java versions - both appear to produce a similar result:

```bash
gradle -v
```

```text
------------------------------------------------------------
Gradle 8.10
------------------------------------------------------------
Build time: 2024-08-14 12:23:39 UTC
Revision: <unknown>
Kotlin: 1.9.24
Groovy: 3.0.22
Ant: Apache Ant(TM) version 1.10.14 compiled on August 16 2023
Launcher JVM: 1.8.0_422 (Arch Linux 25.422-b05)
Daemon JVM: /usr/lib/jvm/java-8-openjdk (no JDK specified, using current Java home)
OS: Linux 6.10.6-arch1-1 amd64
```

```text
------------------------------------------------------------
Gradle 7.2
------------------------------------------------------------
Build time: 2021-08-17 09:59:03 UTC
Revision: a773786b58bb28710e3dc96c4d1a7063628952ad
Kotlin: 1.5.21
Groovy: 3.0.8
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 17.0.10 (Azul Systems, Inc. 17.0.10+7-LTS)
OS: Mac OS X 14.4.1 aarch64
```

You can also view our [GitHub actions workflow](./.github/workflows/build-and-publish.yml) to see the automated build setup.

## Creating tags and releases

Our [GitHub actions workflow](./.github/workflows/build-and-publish.yml) is configured to build a new `.jar` file upon a `tag` push event. If you create a release in GitHub, the workflow will fail, because its purpose is to *create* the release.

The proper process for creating a new build is as follows:

1. `git fetch --all` (ensures everything is up to date - helps prevent creating a tag that someone else already created)
2. `git pull origin master` (sync your local repository with the latest changes)
3. `git tag -a -s v0.0.X`
4. `git push origin v0.0.X`

Swap out `v0.0.X` for your actual version, and please try to use the `-s` flag if you can - using GPG keys to sign tags is preferred.

In a few minutes, a new `.jar` and release will be ready on the releases page!
Binary file removed prebuilt/client-435-0.3.jar
Binary file not shown.

0 comments on commit 0c80ff2

Please sign in to comment.