generated from CleanroomMC/TemplateDevEnv
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* start * massive skill issue * update gha * update buildscript * setup publishing via gradle * convert to java 17 syntax * remove old properties * remove file name var
- Loading branch information
Showing
49 changed files
with
1,726 additions
and
493 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -19,8 +19,12 @@ on: | |
- 'release' | ||
- 'beta' | ||
- 'alpha' | ||
publish-cf-mr: | ||
description: Publish to CF / MR | ||
publish-cf: | ||
description: Publish to CF | ||
default: true | ||
type: boolean | ||
publish-mr: | ||
description: Publish to MR | ||
default: true | ||
type: boolean | ||
publish-gh: | ||
|
@@ -37,6 +41,9 @@ on: | |
required: true | ||
type: boolean | ||
|
||
env: | ||
CHANGELOG_LOCATION: "build/gh_changelog.md" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
@@ -68,7 +75,7 @@ jobs: | |
fi | ||
echo "publish-gh=${{ inputs.publish-gh }}" >> $GITHUB_ENV | ||
else | ||
if [ "${{ inputs.publish-cf-mr }}" == "true" ]; then | ||
if [ "${{ inputs.publish-cf }}" == "true" ] || [ "${{ inputs.publish-mr }}" == "true" ]; then | ||
echo "publish-gh=true" >> $GITHUB_ENV | ||
else | ||
echo "publish-gh=${{ inputs.publish-gh }}" >> $GITHUB_ENV | ||
|
@@ -77,7 +84,7 @@ jobs: | |
- name: Set version | ||
if: env.UPDATED == 'false' # only change new version if it's not already updated | ||
run: sed -i "s/mod_version.*=.*/mod_version = ${{ github.event.inputs.version }}/g" gradle.properties | ||
run: sed -i "s/modVersion.*=.*/modVersion = ${{ github.event.inputs.version }}/g" gradle.properties | ||
|
||
- name: Commit and push gradle.properties | ||
if: env.UPDATED == 'false' # only push new version if it's not already updated | ||
|
@@ -126,46 +133,38 @@ jobs: | |
RELEASE_JSON=$(curl -sSL $RELEASE_URL) | ||
CHANGELOG="$(echo $RELEASE_JSON | jq -r '.body')" | ||
if [ "$CHANGELOG" == "null" ]; then | ||
echo "No changelog found" > build/changelog.md | ||
echo "No changelog found" > $CHANGELOG_LOCATION | ||
else | ||
echo "$CHANGELOG" > build/changelog.md | ||
echo "$CHANGELOG" > $CHANGELOG_LOCATION | ||
fi | ||
- name: Publish Minecraft Mods | ||
if: ${{ inputs.publish-cf-mr }} | ||
uses: Kir-Antipov/[email protected] | ||
- name: Publish to Curseforge | ||
if: env.publish-cf == 'true' | ||
uses: gradle/gradle-build-action@v2 | ||
env: | ||
CURSEFORGE_API_KEY: "${{ secrets.CURSEFORGE_TOKEN }}" | ||
CHANGELOG_LOCATION: $CHANGELOG_LOCATION | ||
RELEASE_TYPE: "${{ inputs.release-type }}" | ||
with: | ||
arguments: 'curseforge' | ||
generate-job-summary: false | ||
|
||
- name: Publish to Modrinth | ||
if: env.publish-mr == 'true' | ||
uses: gradle/gradle-build-action@v2 | ||
env: | ||
MODRINTH_API_KEY: "${{ secrets.MODRINTH_TOKEN }}" | ||
CHANGELOG_LOCATION: $CHANGELOG_LOCATION | ||
RELEASE_TYPE: "${{ inputs.release-type }}" | ||
with: | ||
curseforge-id: 624243 | ||
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | ||
|
||
modrinth-id: Ecvd12QC | ||
modrinth-featured: true | ||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | ||
|
||
files-primary: build/libs/!(*-@(dev|sources|javadoc)).jar | ||
files-secondary: build/libs/*-@(dev|sources|javadoc).jar | ||
name: "${GITHUB_REPOSITORY#*/}-${{ github.event.inputs.version }}" | ||
version: ${{ github.event.inputs.version }} | ||
version-type: ${{ github.event.inputs.release-type }} | ||
changelog-file: build/changelog.md | ||
loaders: | | ||
forge | ||
game-versions: | | ||
1.12.2 | ||
dependencies: | | ||
[email protected](required) | ||
jei(optional) | ||
hei(optional) | ||
blur(optional) | ||
java: | | ||
8 | ||
retry-attempts: 2 | ||
arguments: 'modrinth' | ||
generate-job-summary: false | ||
|
||
- name: Publish to maven | ||
if: ${{ inputs.publish-maven }} | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: publish | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.MAVEN_NAME }} | ||
MAVEN_USER: ${{ secrets.MAVEN_NAME }} | ||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} |
Oops, something went wrong.