-
-
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.
feat!: update to 1.21, rework payload registration
- Loading branch information
1 parent
9b8d6c3
commit 12116b5
Showing
38 changed files
with
1,019 additions
and
186 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 @@ | ||
@JustPyrrha |
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 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "gradle" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
ignore: | ||
- dependency-name: com.mojang:minecraft | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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 @@ | ||
github: JustPyrrha |
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,154 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Build and Test | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 21 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
dependency-graph: generate-and-submit | ||
artifact-retention-days: 1 | ||
|
||
- name: Set Gradle Wrapper Executable | ||
run: chmod +x gradlew | ||
|
||
- name: Build and Test | ||
run: ./gradlew build test spotlessCheck | ||
|
||
publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'wanderia/netlib' | ||
needs: | ||
- build | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 21 | ||
|
||
- name: Set Gradle Wrapper Executable | ||
run: chmod +x gradlew | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Prepare Changelog | ||
id: changelog | ||
run: | | ||
CHANGELOG=$(./gradlew getChangelog --console=plain -q --no-header --no-summary --unreleased --no-empty-sections) | ||
CHANGELOG="${CHANGELOG//$'\n'/'\\n'}" | ||
CHANGELOG="${CHANGELOG//$'\r'/''}" | ||
CHANGELOG=$(sed -E 's/Downloading https:\/\/services\.gradle\.org\/distributions\/gradle-[0-9\\.]*-bin\.zip\\\\n[\\.0-9%]*\\\\n//' <<< $CHANGELOG) | ||
echo "changelog=$CHANGELOG" >> "$GITHUB_OUTPUT" | ||
echo "# Changelog" >> "$GITHUB_STEP_SUMMARY" | ||
echo "" >> "$GITHUB_STEP_SUMMARY" | ||
echo "$CHANGELOG" >> "$GITHUB_STEP_SUMMARY" | ||
- name: Publish to Modrinth | ||
env: | ||
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | ||
run: ./gradlew modrinth modrinthSyncBody | ||
|
||
- name: Publish to GitHub | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
CHANGELOG="${{ steps.changelog.outputs.changelog }}" | ||
NL=$'\n' | ||
CHANGELOG=${CHANGELOG//$'\\n'/"${NL}"} | ||
echo "$CHANGELOG" >> "notes.txt" | ||
gh release create ${{ github.ref_name }} **/build/libs/**.jar --notes-file notes.txt | ||
- name: Patch Changelog | ||
run: ./gradlew patchChangelog | ||
|
||
- name: Create Patched Changelog Pull Request | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
VERSION="${{ github.ref_name }}" | ||
BRANCH="changelog-patch/$VERSION" | ||
git config user.email "github-actions@github.com" | ||
git config user.name "github-actions" | ||
git checkout -b $BRANCH | ||
git add CHANGELOG.md | ||
git commit -m "docs(changelog): patch changelog for $VERSION" | ||
git push -u origin $BRANCH | ||
gh pr create \ | ||
--title "docs(changelog): patch changelog for $VERSION" \ | ||
--body-file notes.txt \ | ||
--base main \ | ||
--head "$BRANCH" | ||
- name: Build Documentation (DokkaHtml) | ||
run: ./gradlew dokkaHtml | ||
|
||
- name: Create Documentation Pull Request | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
VERSION="${{ github.ref_name }}" | ||
BRANCH="documentation-patch/$VERSION" | ||
git config user.email "github-actions@github.com" | ||
git config user.name "github-actions" | ||
git checkout -b $BRANCH | ||
git add docs/ | ||
git commit -m "docs(dokka): patch docs for $VERSION" | ||
git push -u origin $BRANCH | ||
gh pr create \ | ||
--title "docs(dokka): patch docs for $VERSION" \ | ||
--body "Adds published documentation for $VERSION" \ | ||
--base main \ | ||
--head "$BRANCH" | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
|
||
- name: Upload Dokka Artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./docs-publishing/ | ||
|
||
- name: Deploy Dokka Artifact to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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,30 @@ | ||
name: Build (Pull Request) | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 21 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Validate Wrapper | ||
uses: gradle/actions/wrapper-validation@v3 | ||
|
||
- name: Set Gradle Wrapper Executable | ||
run: chmod +x gradlew | ||
|
||
- name: Build, Test, and Check | ||
run: ./gradlew build test spotlessCheck |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
.gradle/ | ||
.idea/ | ||
.kotlin/ | ||
build/ | ||
run/ | ||
docs-publishing/ | ||
runs/ | ||
*.iml |
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 @@ | ||
# Changelog | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
### Added | ||
- `wanderia-netlib` entrypoint as new standard for registering payload types. | ||
- `WanderiaSerializersModule` used by default in payload serialization. | ||
- `UUIDSerializer` as a default contextual serializer. | ||
- `IdentifierSerialzier` as a default contextual serializer. | ||
- Spotless formatting and checking. | ||
|
||
### Changed | ||
- Updated to Minecraft `1.21` | ||
- Updated to Kotlin `2.0.0` | ||
- Updated to Kotlinx Serialization `1.7.1` | ||
- Updated to Fabric Loom `1.7-SNAPSHOT` | ||
- Updated to Fabric Loader `0.16.0` | ||
- Updated to Fabric API `0.100.7+1.21` | ||
|
||
### Deprecated | ||
|
||
### Removed | ||
- `dev.wanderia.netlib.samples` has been replaced with a full example test mod in `src/testmod`. | ||
- Yumi licenser (replaced by spotless) | ||
|
||
### Fixed | ||
|
||
### Security | ||
|
||
## [1.0.0] - 2024-02-16 | ||
|
||
### Added | ||
- Initial release |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Copyright (C) ${YEAR} Wanderia - All Rights Reserved | ||
|
||
This Source Code Form is subject to the terms of the Mozilla Public | ||
License, v. 2.0. If a copy of the MPL was not distributed with this | ||
file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
#type YEAR YEAR_LENIENT_RANGE | ||
/* | ||
* Copyright (C) 2024 Wanderia - All Rights Reserved | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ |
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 |
---|---|---|
@@ -1,10 +1,23 @@ | ||
# netlib | ||
Wanderia's networking utility library. | ||
Kotlinx Serialization for Minecraft Payloads. | ||
|
||
### Features | ||
- Kotlinx Serialization encoder/decoder for Minecraft's FriendlyByteBuf/PacketByteBuf. | ||
- Abstract `SerializedPacket` for easy packet creation. | ||
- Abstract `SerializedPayload` for easy packet creation. | ||
|
||
### Developer Usage | ||
Usage samples can be found in the [`dev.wanderia.netlib.samples`](https://github.com/wanderia/netlib/tree/main/src/main/kotlin/dev/wanderia/netlib/sample/) package.\ | ||
This project is intended to be included via Jar-in-Jar. | ||
netlib is available on the wanderia maven. | ||
```kotlin | ||
repositories { | ||
maven("https://maven.wanderia.dev/releases") { name = "Wanderia" } | ||
} | ||
dependencies { | ||
include("dev.wanderia:netlib:$version") | ||
modImplementation("dev.wanderia:netlib:$version") | ||
} | ||
``` | ||
See the [testmod](src/testmod/) for example usage. | ||
|
||
## Attribution | ||
Logo icon by [Iconoir](https://iconoir.com/) which is licensed under MIT. |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.