Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Sergey Shatunov <me@aur.rocks>
  • Loading branch information
Prototik committed Jan 8, 2024
0 parents commit d455614
Show file tree
Hide file tree
Showing 56 changed files with 37,556 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
*.bat text eol=crlf
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build

on:
workflow_dispatch:
workflow_call:

permissions:
checks: write
pull-requests: write

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
gradle: [ '8.6-rc-1', '8.5', '8.0.2', '7.0.2' ]
java: [ 8, 11, 17, 21 ]
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: ${{ matrix.gradle }}
- name: Build
run: ./gradlew -s build
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/build/test-results/*/TEST-*.xml'
23 changes: 23 additions & 0 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Validate Gradle Wrapper

on:
push:
paths:
- gradlew
- gradlew.bat
- gradle/wrapper/
pull_request:
paths:
- gradlew
- gradlew.bat
- gradle/wrapper/

jobs:
validation:
name: Validation
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
19 changes: 19 additions & 0 deletions .github/workflows/update-gradle-wrapper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Update Gradle Wrapper

on:
workflow_dispatch:
schedule:
- cron: "0 10 * * *"

jobs:
update-gradle-wrapper:
name: Update Gradle Wrapper
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Update Gradle Wrapper
uses: gradle-update/update-gradle-wrapper-action@v1
with:
labels: deps
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
*.private.env.json

### IntelliJ IDEA ###
.idea/*
!.idea/codeStyles
!.idea/runConfigurations
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
12 changes: 12 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions .idea/runConfigurations/Run_tests.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

121 changes: 121 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
Creative Commons Legal Code

CC0 1.0 Universal

CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.

Statement of Purpose

The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").

Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.

For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.

1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:

i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.

2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.

3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.

4. Limitations and Disclaimers.

a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
88 changes: 88 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Cursed Publish plugin

[![Gradle versions](https://img.shields.io/badge/Gradle-7.0_--_8.5-02303A?logo=gradle&logoColor=02303A&labelColor=white)](https://gradle.org)
![Java versions](https://img.shields.io/badge/Java-8_--_21-f7901e?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDE2IDE2IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Im03LjY2NzMgOC41OTE0cy0wLjg5MTk0LTEuNzE4Ny0wLjg1OS0yLjk3NDZjMC4wMjQwMzMtMC44OTc0NSAyLjA0NzYtMS43ODQ2IDIuODQyLTMuMDcyNyAwLjc5MzA3LTEuMjg4OS0wLjA5ODg3Mi0yLjU0NC0wLjA5ODg3Mi0yLjU0NHMwLjE5ODQ0IDAuOTI1NTktMC4zMzAyOSAxLjg4MjhjLTAuNTI4NyAwLjk1ODU3LTIuNDgwMiAxLjUyMDktMy4yMzg5IDMuMTczLTAuNzU4NzMgMS42NTIxIDEuNjg1IDMuNTM1NiAxLjY4NSAzLjUzNTZ6IiBmaWxsPSIjZjc5MDFlIiBzdHJva2Utd2lkdGg9Ii4wMzE4MzIiLz48cGF0aCBkPSJtMTEuMDA2IDMuMzcwMXMtMy4wMzk4IDEuMTU3LTMuMDM5OCAyLjQ3ODFjMCAxLjMyMjUgMC44MjUzNSAxLjc1MTYgMC45NTg1NyAyLjE4MDggMC4xMzE4NSAwLjQzMDUzLTAuMjMxMzkgMS4xNTctMC4yMzEzOSAxLjE1N3MxLjE4OTMtMC44MjYwNSAwLjk5MDE1LTEuNzg0NmMtMC4x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jM1NjggMC4xMzMyMmMxLjg3NDUtMC4zMjY4NiAxLjk4MzctMS4yMzM5IDEuOTgzNy0xLjIzMzlzLTAuNTczMzMgMC42MTcyOS0yLjMxNCAwLjk3MDkyeiIvPjwvZz48L3N2Zz4K&labelColor=white)

Plugin to automatically publish artifacts (mods) on the CurseForge portal directly from Gradle build lifecycle.

## Setup

[![Latest version](https://img.shields.io/gradle-plugin-portal/v/rocks.aur.cursed.publish?logo=gradle&label=Latest%20version&color=%2302303A)](https://plugins.gradle.org/plugin/rocks.aur.cursed.publish)

<details open>
<summary>Kotlin buildscript</summary>

```kotlin
plugins {
id("rocks.aur.cursed.publish") version "<version>"
}
```
</details>

<details>
<summary>Groovy buildscript</summary>

```groovy
plugins {
id 'rocks.aur.cursed.publish' version '<version>'
}
```
</details>

## Configuration

```kotlin
cursedPublish {
projectId("<curseforge-project-id>") // numeric project id from mod page
apiToken("<curseforge-token>") // curseforge token from settings page

// You can use AbstractArchiveTask here to set file name and file source at the same type
file(tasks.jar) {
// Display name for mod file
displayName("MyCoolMod (Fabric)")

// Changelog
changelog(CursedChangelogType.Text, "Some changelog")

// Minecraft version
minecraft("1.20.4")

// ModLoader, usually only one
forge()
neoForge()
fabric()
quilt()

// Java version
java(17)

// Environment
client()
server()

// Release type
alpha()
beta()
release()

relations {
// Define dependencies to other curseforge projects
// You cannot declare one slug more than once
requiredDependency("<project-slug>")
optionalDependency("<project-slug>")
embeddedLibrary("<project-slug>")
incompatible("<project-slug>")
tool("<project-slug>")
}

additionalFile(tasks.sourcesJar) {
// the same as file, but you cannot define game versions
// (minecraft, modloader, java, environment) and nested files here
}
}
}
```

Plugin will create task for each top-level file (for example, when you register file with name `jar`, plugin will create task `curseforgeUploadJarFile` to upload file itself and all of its additional files).

All such tasks aggregated into `curseforgeUploadAllFiles` meta task to publish all declared files.
Loading

0 comments on commit d455614

Please sign in to comment.