Skip to content

Commit

Permalink
publish release on push, update dependencies, update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Grabsky committed Jun 13, 2024
1 parent 98d64ec commit eceb674
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 41 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,30 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout
- uses: actions/checkout@v3
# JDK 17
- name: JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
# Publish
- name: Publish
uses: gradle/gradle-build-action@v2
with:
arguments: publish
env:
# GitHub Packages
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Expose Release Name
- name: Expose Release Name
run: echo "PROJECT_RELEASE_NAME=$( ./gradlew release -q --no-rebuild )" >> $GITHUB_ENV
# Expose Tag
- name: Expose Tag
run: echo "PROJECT_TAG=$( ./gradlew tag -q --no-rebuild )" >> $GITHUB_ENV
# Release
- name: Release
uses: ncipollo/release-action@v1
with:
name: "${{ env.PROJECT_RELEASE_NAME }}"
tag: "${{ env.PROJECT_TAG }}"
39 changes: 20 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# commands
<span>
<a href=""><img alt="Maven metadata URL" src="https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Frepo.grabsky.cloud%2Freleases%2Fcloud%2Fgrabsky%2Fcommands%2Fmaven-metadata.xml&style=for-the-badge&logo=gradle&label=%20"></a>
<a href=""><img alt="GitHub Workflow Status (with event)" src="https://img.shields.io/github/actions/workflow/status/Grabsky/commands/gradle.yml?style=for-the-badge&logo=github&logoColor=white&label=%20"></a>
<a href=""><img alt="CodeFactor Grade" src="https://img.shields.io/codefactor/grade/github/Grabsky/commands/main?style=for-the-badge&logo=codefactor&logoColor=white&label=%20"></a>
</span>
<p></p>

[![Latest Release](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.github.com%2Frepos%2FGrabsky%2Fcommands%2Freleases%2Flatest&query=tag_name&logo=gradle&style=for-the-badge&label=%20&labelColor=%231C2128&color=%23454F5A)](https://github.com/Grabsky/commands/packages/1935522)
[![Build Status](https://img.shields.io/github/actions/workflow/status/Grabsky/commands/gradle.yml?style=for-the-badge&logo=github&logoColor=white&label=%20)](https://github.com/Grabsky/commands/actions)
[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/Grabsky/commands/main?style=for-the-badge&logo=codefactor&logoColor=white&label=%20)](https://www.codefactor.io/repository/github/grabsky/commands)

Simple, no non-sense command framework for **[Paper](https://github.com/PaperMC/Paper)** servers.

Brigadier is not currently supported, nor is it guaranteed to be supported in the future.
Brigadier is not currently supported, nor is it guaranteed to be supported in the future. Contributions are welcome.

<br />

Expand All @@ -18,20 +16,23 @@ Requires **Java 17** (or higher) and **Paper 1.20.1** (or higher).
<br />

## Getting Started
To use this project in your plugin, add following repository:
Library is published to the **[GitHub Packages Registry](https://github.com/Grabsky/commands/packages/)** and may require additional configuration. You can find more details **[here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#using-a-published-package)**.
```groovy
repositories {
maven { url = 'https://repo.grabsky.cloud/releases' }
maven { url = "https://maven.pkg.github.com/grabsky/commands"
credentials {
username = findProperty("gpr.actor") ?: System.getenv("GITHUB_ACTOR")
password = findProperty("gpr.token") ?: System.getenv("GITHUB_TOKEN")
}
}
}
```
Then specify dependency:

```groovy
dependencies {
implementation 'cloud.grabsky:commands:[_VERSION_]'
}
```
You can also use [GitHub Packages](https://github.com/Grabsky/commands/packages/) - read more about that [here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#using-a-published-package).


<br />

Expand All @@ -40,17 +41,17 @@ Documentation and examples are available **[here](https://github.com/Grabsky/com

<br />

## Building (Linux)
## Building
```bash
# Cloning repository
# Cloning the repository.
$ git clone https://github.com/Grabsky/commands.git
# Entering cloned repository
$ cd ./commands
# Compiling and publishing to maven local
$ ./gradlew clean publishToMavenLocal
# Entering the cloned repository.
$ cd commands
# Compiling and publishing to maven local.
$ gradlew clean publishToMavenLocal
```

<br />

## Contributing
This project is open for contributions. Help in regards of improving performance, adding new features or fixing bugs is greatly appreciated.
This project is open for contributions. I'm currently looking for help in implementing presence and parameter flags for commands.
46 changes: 25 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
plugins {
id "java-library"
id "maven-publish"
id("java-library")
id("maven-publish")
}

group = "cloud.grabsky"
version = "1.20.1-${System.getenv("GITHUB_RUN_NUMBER") ?: "DEV"}"

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
repositories {
mavenCentral()
maven { url = "https://repo.papermc.io/repository/maven-public/" }
}

dependencies {
// JetBrains Annotations
compileOnly("org.jetbrains:annotations:24.1.0")
// Lombok
compileOnly("org.projectlombok:lombok:1.18.32")
annotationProcessor("org.projectlombok:lombok:1.18.32")
// Paper API
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
}

publishing {
repositories {
Expand All @@ -20,35 +32,27 @@ publishing {
}
}
publications {
maven(MavenPublication) { from components.java }
register("maven", MavenPublication.class) {
from components.java
}
}
}

java {
withJavadocJar()
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

javadoc {
(options as CoreJavadocOptions).addStringOption("Xdoclint:none", "-quiet")
}

repositories {
mavenCentral()
maven { url = "https://repo.papermc.io/repository/maven-public/" }
}

dependencies {
// JetBrains Annotations
compileOnly("org.jetbrains:annotations:24.0.0")
// Lombok
compileOnly("org.projectlombok:lombok:1.18.24")
annotationProcessor("org.projectlombok:lombok:1.18.24")
// Paper API
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
tasks.register("release") {
print("${version.toString().split('-')[0]} #${System.getenv("GITHUB_RUN_NUMBER")}")
}

gradle.buildFinished {
println()
println("> " + version)
tasks.register("tag") {
print(version)
}

0 comments on commit eceb674

Please sign in to comment.