mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-08 23:06:58 -04:00
Merge remote-tracking branch 'origin/master-MC1.7.10' into master-MC1.12
This commit is contained in:
commit
51481f12c7
41
.github/workflows/build.yml
vendored
Normal file
41
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
name: Java CI with Gradle
|
||||
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'temurin'
|
||||
- name: Validate Gradle wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
|
||||
restore-keys: ${{ runner.os }}-gradle-
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
env:
|
||||
GPR_USER: ${{ secrets.GPR_USER }}
|
||||
GPR_KEY: ${{ secrets.GPR_KEY }}
|
||||
- name: Archive artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: OpenComputers
|
||||
path: build/libs/*-universal.jar
|
||||
- name: Archive artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: OpenComputers (development environment build)
|
||||
path: build/libs/*-dev.jar
|
154
.github/workflows/publish.yml
vendored
Normal file
154
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,154 @@
|
||||
name: publish
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
publish-github:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Extract Version from Tag
|
||||
uses: rishabhgupta/split-by@v1
|
||||
id: split_tag
|
||||
with:
|
||||
string: ${{ github.event.release.tag_name }}
|
||||
split-by: '/'
|
||||
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Validate Gradle wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ubuntu-latest-gradle-${{ hashFiles('**/*.gradle*') }}
|
||||
restore-keys: ubuntu-latest-gradle-
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew -Pmod_version='${{ steps.split_tag.outputs._1 }}' build
|
||||
env:
|
||||
GPR_USER: ${{ secrets.GPR_USER }}
|
||||
GPR_KEY: ${{ secrets.GPR_KEY }}
|
||||
|
||||
- name: Add Artifacts to Github Release
|
||||
uses: alexellis/upload-assets@0.3.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
with:
|
||||
asset_paths: '["./build/libs/*.jar"]'
|
||||
|
||||
- name: Publish to Github Packages
|
||||
run: gradle -Pmod_version='${{ steps.split_tag.outputs._1 }}' publish
|
||||
env:
|
||||
GPR_USER: ${{ secrets.GPR_USER }}
|
||||
GPR_KEY: ${{ secrets.GPR_KEY }}
|
||||
GITHUB_MAVEN_URL: 'https://maven.pkg.github.com/${{ github.repository }}'
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
publish-curse:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Extract Version from Tag
|
||||
uses: rishabhgupta/split-by@v1
|
||||
id: split_tag
|
||||
with:
|
||||
string: ${{ github.event.release.tag_name }}
|
||||
split-by: '/'
|
||||
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Validate Gradle wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ubuntu-latest-gradle-${{ hashFiles('**/*.gradle*') }}
|
||||
restore-keys: ubuntu-latest-gradle-
|
||||
|
||||
# Set Curseforge release type based on pre-release flag.
|
||||
- name: Set release type to 'release'
|
||||
run: |
|
||||
echo "CURSEFORGE_RELEASE_TYPE=release" >> $GITHUB_ENV
|
||||
if: github.event.release.prerelease == false
|
||||
- name: Set release type to 'alpha'
|
||||
run: |
|
||||
echo "CURSEFORGE_RELEASE_TYPE=alpha" >> $GITHUB_ENV
|
||||
if: github.event.release.prerelease == true
|
||||
|
||||
- name: Publish to Curseforge
|
||||
run: ./gradlew -Pmod_version='${{ steps.split_tag.outputs._1 }}' curseforge
|
||||
env:
|
||||
GPR_USER: ${{ secrets.GPR_USER }}
|
||||
GPR_KEY: ${{ secrets.GPR_KEY }}
|
||||
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
|
||||
CURSEFORGE_RELEASE_TYPE: ${{ env.CURSEFORGE_RELEASE_TYPE }}
|
||||
CHANGELOG: ${{ github.event.release.body }}
|
||||
|
||||
publish-modrinth:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Extract Version from Tag
|
||||
uses: rishabhgupta/split-by@v1
|
||||
id: split_tag
|
||||
with:
|
||||
string: ${{ github.event.release.tag_name }}
|
||||
split-by: '/'
|
||||
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Validate Gradle wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ubuntu-latest-gradle-${{ hashFiles('**/*.gradle*') }}
|
||||
restore-keys: ubuntu-latest-gradle-
|
||||
|
||||
# Set Modrinth release type based on pre-release flag.
|
||||
- name: Set release type to 'release'
|
||||
run: |
|
||||
echo "MODRINTH_RELEASE_TYPE=release" >> $GITHUB_ENV
|
||||
if: github.event.release.prerelease == false
|
||||
- name: Set release type to 'alpha'
|
||||
run: |
|
||||
echo "MODRINTH_RELEASE_TYPE=alpha" >> $GITHUB_ENV
|
||||
if: github.event.release.prerelease == true
|
||||
|
||||
- name: Publish to Modrinth
|
||||
run: ./gradlew -Pmod_version='${{ steps.split_tag.outputs._1 }}' modrinth
|
||||
env:
|
||||
GPR_USER: ${{ secrets.GPR_USER }}
|
||||
GPR_KEY: ${{ secrets.GPR_KEY }}
|
||||
MODRINTH_API_KEY: ${{ secrets.MODRINTH_API_KEY }}
|
||||
MODRINTH_RELEASE_TYPE: ${{ env.MODRINTH_RELEASE_TYPE }}
|
||||
CHANGELOG: ${{ github.event.release.body }}
|
37
build.gradle
37
build.gradle
@ -17,6 +17,7 @@ buildscript {
|
||||
|
||||
plugins {
|
||||
id "com.matthewprenger.cursegradle" version "1.4.0"
|
||||
id 'com.modrinth.minotaur' version '2.2.0'
|
||||
}
|
||||
|
||||
apply plugin: 'scala'
|
||||
@ -42,7 +43,7 @@ file "build.properties" withReader {
|
||||
ext.config = new ConfigSlurper().parse prop
|
||||
}
|
||||
|
||||
version = config.mod.version
|
||||
version = "${mod_version}"
|
||||
group = config.mod.group
|
||||
archivesBaseName = config.mod.name
|
||||
|
||||
@ -59,12 +60,7 @@ def getGitRef() {
|
||||
}
|
||||
}
|
||||
|
||||
if (System.getenv("PROMOTED_NUMBER") != null)
|
||||
version += ".${System.getenv("PROMOTED_NUMBER")}"
|
||||
else if (System.getenv("BUILD_NUMBER") != null)
|
||||
version += ".${System.getenv("BUILD_NUMBER")}"
|
||||
else
|
||||
version += "+" + getGitRef()
|
||||
version += "+" + getGitRef()
|
||||
|
||||
ext.simpleVersion = version
|
||||
version = "MC${config.minecraft.version}-${project.version}"
|
||||
@ -293,6 +289,9 @@ artifacts {
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
groupId = project.group
|
||||
artifactId = project.name
|
||||
version = mod_version
|
||||
artifact jar
|
||||
artifact apiJar
|
||||
artifact javadocJar
|
||||
@ -300,20 +299,36 @@ publishing {
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
url System.getenv("MAVEN_PATH")
|
||||
name = "GitHubPackages"
|
||||
url = System.getenv("GITHUB_MAVEN_URL") ?: ""
|
||||
credentials {
|
||||
username = System.getenv("GITHUB_ACTOR")
|
||||
password = System.getenv("GITHUB_TOKEN")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
curseforge {
|
||||
apiKey = project.hasProperty("curseForgeApiKey") ? project.curseForgeApiKey : ""
|
||||
apiKey = System.getenv('CURSEFORGE_API_KEY') ?: ""
|
||||
project {
|
||||
id = config.curse.project.id
|
||||
releaseType = config.curse.project.releaseType
|
||||
releaseType = System.getenv('CURSEFORGE_RELEASE_TYPE') ?: "alpha"
|
||||
changelogType = "markdown"
|
||||
changelog = file("changelog.md")
|
||||
changelog = System.getenv("CHANGELOG") ?: "Changelog not available."
|
||||
addGameVersion config.minecraft.version
|
||||
addGameVersion "Java 8"
|
||||
addGameVersion "Forge"
|
||||
}
|
||||
}
|
||||
|
||||
modrinth {
|
||||
token = System.getenv("MODRINTH_API_KEY") ?: ""
|
||||
projectId = config.modrinth.project.id
|
||||
changelog = System.getenv("CHANGELOG") ?: "Changelog not available."
|
||||
versionNumber = mod_version
|
||||
versionName = "${rootProject.name}-${version}"
|
||||
versionType = System.getenv('MODRINTH_RELEASE_TYPE') ?: "alpha"
|
||||
uploadFile = jar
|
||||
gameVersions = [config.minecraft.version]
|
||||
}
|
||||
|
@ -29,4 +29,4 @@ enderstorage.version=2.4.5.135
|
||||
wrcbe.version=2.3.2.33
|
||||
|
||||
curse.project.id=223008
|
||||
curse.project.releaseType=release
|
||||
modrinth.project.id=YiAbZis2
|
||||
|
@ -0,0 +1 @@
|
||||
mod_version=0.0.0
|
Loading…
x
Reference in New Issue
Block a user