Skip to content

Commit

Permalink
feat: initial beta (#24)
Browse files Browse the repository at this point in the history
* chore: flesh out mod template

* feat(api): init `minecord-api` module

* build(api): produce a fat-jar of all shaded dependencies

includes JDA and SLF4J binding

* feat(api): add string template utility class

* feat(api): add custom entrypoint for use in addons

* build(api): do not relocate JDA itself

* feat(api): add string utility helpers

with Minecraft and Discord formatting conversions

* feat(api): expose the Minecraft server instance

fix(api): JDA shutting down before addons handle server shutdown

* feat(chat): init `minecord-chat` module (#5)

* feat(cmds): init `minecord-cmds` module (#7)

* feat(presence): init `minecord-presence` module (#8)

* docs: add logos & icons (#9)

* refactor: rename placeholder callbacks (#10)

* refactor: rename config schema classes (#11)

* ci: fix conditions for applying `assets` & `ci` labels (#12)

Refs: axieum/fabric-example-mod#22, axieum/fabric-example-mod#23

* feat: upgrade to Minecraft 1.18 (#13)

* build(gradle): upgrade Gradle

7.1 -> 7.3

* feat: upgrade to Minecraft 1.18

* ci: upgrade Java

16 -> 17

* build: update build.gradle

* feat!: upgrade Minecraft (1.18 -> 1.18.2) (#14)

ci!: use `googleapis/release-please` for releases

build: upgrade Gradle wrapper (7.3 -> 7.4.1)

* feat!: upgrade Minecraft (1.18.2 -> 1.19-pre1) (#15)

deps: upgrade cloth-config-fabric (6.2.57 -> 7.0.65)

deps(build): upgrade Checkstyle (10.1 -> 10.2)

ci: add the latest changelog notes when publishing

* feat!: upgrade JDA (4.4.0 -> 5.0.0-alpha.12) (#16)

* feat(cmds): add configurable command cooldowns (#17)

feat(cmds): remove command permissions from config
  permissions are to be configured via the Discord client itself

fix(cmds): custom commands should not fail when called from a private channel

* feat(api): add support for lazy variables in string templates (#18)

docs(LICENCE): extend licence date through to 2022

docs: update project name in Security Policy

style: github labeler yaml formatting

* perf(cmds): reusable string template for the uptime command (#19)

* feat!: upgrade Minecraft (1.19-pre1 -> 1.19) (#20)

deps: upgrade yarn mappings (1.19-pre1+build.6 -> 1.19+build.1)

deps: upgrade fabric-api (0.53.0+1.19 -> 0.55.2+1.19)

deps(ci): upgrade Minotaur (2.1.1 -> 2.2.0)

deps(build): upgrade fabric-loom (0.11-SNAPSHOT -> 0.12-SNAPSHOT)

deps(build): upgrade Checkstyle (10.2 -> 10.3)
  • Loading branch information
axieum authored Jun 9, 2022
1 parent 83b7149 commit d053f57
Show file tree
Hide file tree
Showing 123 changed files with 6,579 additions and 641 deletions.
8 changes: 6 additions & 2 deletions .checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
<module name="AvoidStarImport"/>
<module name="IllegalImport"/>
<module name="ImportOrder">
<!-- todo: replace 'com.example' import group -->
<property name="groups" value="java,javax,*,com.mojang,net.minecraft,net.fabricmc,com.example"/>
<property name="groups" value="java,javax,*,com.mojang,net.minecraft,net.fabricmc,me.axieum.mcmod.minecord"/>
<property name="separated" value="true"/>
</module>
<module name="RedundantImport"/>
Expand All @@ -70,6 +69,7 @@
<!-- See https://checkstyle.org/config_annotation.html -->
<module name="AnnotationLocation"/>
<module name="MissingOverride"/>
<module name="SuppressWarningsHolder"/>

<!-- Checks for modifiers -->
<!-- See https://checkstyle.org/config_modifiers.html -->
Expand Down Expand Up @@ -191,4 +191,8 @@
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>

<!-- Enables suppression of audit events -->
<!-- See https://checkstyle.org/config_filters.html#SuppressWarningsFilter -->
<module name="SuppressWarningsFilter"/>

</module>
5 changes: 3 additions & 2 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ representative at an online or offline event.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at [email]. All
complaints will be reviewed and investigated promptly and fairly.
reported to the community leaders responsible for enforcement at
[email protected]. All complaints will be reviewed and investigated promptly
and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
Expand Down
20 changes: 5 additions & 15 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ made regularly.
At any given time, the latest code that exists in production can be found under
the `main` branch.

#### `next` / `next-major`

An upcoming major release can be found under the `next` or `next-major`
branches. For example, if `main` is currently on `v2.4.1`, the next major
release is expected to be on `v3.0.0`.

#### `beta` / `alpha`

The latest Beta and Alpha releases can be found under the `beta` and `alpha`
Expand Down Expand Up @@ -117,18 +111,15 @@ pattern `+([0-9])?(.{+([0-9]),x}).x`, e.g. `2.x`.
## Continuous Integration & Deployment (CI/CD)

This project uses [GitHub Actions][github:actions] in tandem
with [semantic-release][semantic-release] to automate building, testing and
with [release-please][release-please] to automate building, testing and
deploying new versions of the codebase.

Please refer to the following [recipes][semantic-release:recipes] for triggering
new releases.

### How it works?

When new commits make their way into one of the release branches outlined in
the [Branching Strategy](#branching-strategy), a
GitHub [workflow][workflow:publish] is triggered. This workflow in turn
executes [semantic-release][semantic-release].
GitHub [workflow][workflow:release] is triggered. This workflow in turn
executes [release-please][release-please].

## Code Style

Expand All @@ -149,7 +140,6 @@ this functionality to your IDE.
[conventionalcommits]: https://www.conventionalcommits.org/
[github:actions]: https://github.com/features/actions
[github:flow]: https://guides.github.com/introduction/flow
[semantic-release]: https://github.com/semantic-release/semantic-release
[semantic-release:recipes]: https://github.com/semantic-release/semantic-release/blob/v17.4.4/docs/recipes
[release-please]: https://github.com/googleapis/release-please
[semver]: https://semver.org/
[workflow:publish]: workflows/publish.yml
[workflow:release]: workflows/release.yml
7 changes: 2 additions & 5 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
blank_issues_enabled: true
contact_links:
- name: Wiki
url: https://github.com/axieum/fabric-example-mod/wiki
url: https://github.com/axieum/minecord/wiki
about: Please find helpful guides related to using the mod here
- name: GitHub Discussions
url: https://github.com/axieum/fabric-example-mod/discussions
url: https://github.com/axieum/minecord/discussions
about: Please ask and answer any questions regarding the mod here
- name: Join Discord
url: https://discord.gg/example
about: Please get involved with the mod's community here
- name: About Fabric
url: https://fabricmc.net/
about: Please find information regarding the Fabric mod loader here
26 changes: 24 additions & 2 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,36 @@

## Reporting a Vulnerability

If you discover a security vulnerability within Example, please send an e-mail
to [fullname] at [email]. All security vulnerabilities will be promptly
If you discover a security vulnerability within Minecord, please send an e-mail
to Axieum at [email protected]. All security vulnerabilities will be promptly
addressed.

### Public PGP Key

```asc
-----BEGIN PGP PUBLIC KEY BLOCK-----

mJMEXOdhSxMFK4EEACMEIwQBkhkMOGffdgFVMrzpV7WWG1FeTXI165cpkvgr+Dp/
zRZ0HIm52R5J1WRXPOZEnkI7nHRoV5YAnvyeYR94IwlHhEMAD6FDudj6mmIT58ow
RwT95pgLC4+tMvbLvOcx9cb9urh7/SbfEiFJNSanIgnJdQGa4omh8lhiAqXHRaus
zgRY7U+0MEF4aWV1bSA8NzU3Nzg1MStheGlldW1AdXNlcnMubm9yZXBseS5naXRo
dWIuY29tPojUBBMTCgA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAFiEERS+k
1PPIZ9BN04yGnJWZUGvSL+8FAl0TdjIACgkQnJWZUGvSL+9Z4AIJAYhtRlJk5MJA
vkVRYnOFUin1N2AD0AuosB/s88OujpbDZvax6tq7cujAx48+ITqgRrj9qDSEvXTQ
u9457AJhBi4/AgkB2W0aSAbVLLfmS3r+nIRM+r46yuLAQ7IBB6O0hTg1//bBaMGJ
FssXa+/6e1iIjIU8fSr2fz+0edv+Fgur1PbGwCaI0gQTEwoAOBYhBEUvpNTzyGfQ
TdOMhpyVmVBr0i/vBQJc52FLAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJ
EJyVmVBr0i/vLzYCCLlLIm5tmz5FanxhK8ajZFR8aSs6Sd42BQHc2Fjhm2M99INS
qViHxdxSf04PvUQHF6EdlZ5Tqnd/yZPbv4rL5qF5Agdi2in7ND6AKJGrWDIOWCeq
sbRk+H3E9Ta1zZ4UL9iBx04BNC0BDJgwcgrbwls3cW7gFoxiry2ROkOE/FASqRIx
D7iXBFznYUsSBSuBBAAjBCMEAfs1BM0JpMMCn/cKACBqb+Pw3khxSk4o5Cf/bRkY
WOppxdg43KbcYEFTZNRw4cJoFrQF+07ucYSQwJ2Z4bR2uKVFAIsU4SpDXJgTWSai
vrSKuP4r91OjzZ2TGa+sUNvxaedZk4RwsUVT+GELL12XGOLFDBgIr+bbpnhe52m4
uw06QRUpAwEKCYi7BBgTCgAgFiEERS+k1PPIZ9BN04yGnJWZUGvSL+8FAlznYUsC
GwwACgkQnJWZUGvSL+8q8wIJARMOWupdgz3FiUEs8BYb9vZEmUKTwzzOrbsxjAqt
SEnRJ+5ZuHV2xqjLK/fLrI/aAPU5pc4zkRehpI97Cf6GFd1UAgjkHH066H6l0inL
Wyn83wdcCivhc8GMjXeCzTA+g2AaDOs8U9eKNjLrHrQkd5L6HKFGtH8YMdabsqRz
4U1sAmnQKw==
=A81n
-----END PGP PUBLIC KEY BLOCK-----
```
13 changes: 8 additions & 5 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ i18n: '**/assets/*/lang/*'

# Add 'assets' label for changes to assets (except localisation)
assets:
- '**/assets/**/*'
- '!**/assets/*/lang/*'
- any: ['**/assets/**/*', '!**/assets/*/lang/*']

# Add 'ci' label for changes to the deployment process
ci:
- '.releaserc*'
- '.github/workflows/publish.yml'
- any: ['.github/workflows/**/*', '!.github/workflows/build.yml']
- '.github/labeler.yml'

# Add 'build' label for changes to the build process
build:
Expand All @@ -25,5 +25,8 @@ build:
- '.github/workflows/build.yml'

# Add 'modid' labels for changes to their respective codebases
#modid: 'src/**/*'
#modid-sub: 'example-submod/**/*'
minecord: 'src/**/*'
minecord-api: 'minecord-api/**/*'
minecord-chat: 'minecord-chat/**/*'
minecord-cmds: 'minecord-cmds/**/*'
minecord-presence: 'minecord-presence/**/*'
26 changes: 26 additions & 0 deletions .github/release-please.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"release-type": "simple",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"group-pull-request-title-pattern": "chore: release v${version}",
"extra-files": ["gradle.properties"],
"packages": {
".": {
"component": "minecord",
"include-component-in-tag": false,
"pull-request-title-pattern": "chore: release v${version}"
},
"minecord-api": {
"component": "api"
},
"minecord-chat": {
"component": "chat"
},
"minecord-cmds": {
"component": "cmds"
},
"minecord-presence": {
"component": "presence"
}
}
}
36 changes: 15 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,36 @@ jobs:
- name: ✨ Checkout repository
uses: actions/checkout@v2

- name: 🛂 Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: 🏗 Set up JDK 16
- name: ☕ Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 16
java-version: 17
distribution: adopt

- name: 📷 Begin Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: 🐘 Set up Gradle
uses: gradle/gradle-build-action@v2

- name: 🧪 Run tests
run: ./gradlew check

- name: 🔨 Build artifacts
run: gradle clean build
run: ./gradlew build publishToMavenLocal

- name: 📦 Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: artifacts
path: '**/build/libs/'

- name: 📝 Upload reports
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: reports
path: '**/build/reports/'

- name: 🧨 Cleanup Gradle cache
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
- name: 🗃 Upload Maven local
uses: actions/upload-artifact@v3
with:
name: maven
path: ~/.m2/repository/
66 changes: 0 additions & 66 deletions .github/workflows/publish.yml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Prepares, builds and publishes new releases

name: Release

# On changes to release branches
on:
push:
branches:
- main
- master
workflow_dispatch:

jobs:
release:
name: Release

runs-on: ubuntu-latest

steps:
- name: 🙌 Prepare release
id: release-please
uses: GoogleCloudPlatform/release-please-action@v3
with:
command: manifest
config-file: .github/release-please.json
token: ${{ secrets.GITHUB_TOKEN }}

outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
tag_name: ${{ steps.release-please.outputs.tag_name }}

publish:
name: Publish

runs-on: ubuntu-latest
needs: release
if: ${{ needs.release.outputs.release_created }}

steps:
- name: ✨ Checkout repository
uses: actions/checkout@v2

- name: ☕ Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 17
distribution: adopt

- name: 🐘 Set up Gradle
uses: gradle/gradle-build-action@v2

- name: 📢 Publish new release
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}

- name: 📦 Upload artifacts
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.release.outputs.tag_name }}
files: '**/build/libs/*'
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ run/

# log files
*.log
*.log.gz

# packaged files
*.ear
Expand Down
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{".":"1.0.0-alpha.1","minecord-api":"1.0.0-alpha.1","minecord-chat":"1.0.0-alpha.1","minecord-cmds":"1.0.0-alpha.1","minecord-presence":"1.0.0-alpha.1"}
Loading

0 comments on commit d053f57

Please sign in to comment.