-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚧 Seperate build actions per modloader
- Loading branch information
1 parent
38013e7
commit 50ba07f
Showing
4 changed files
with
271 additions
and
17 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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Build and Sign Mod | ||
on: | ||
push: | ||
paths: | ||
- 'release_build_common' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: Build | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Read modid from gradle.properties | ||
id: mod_id | ||
uses: Reedyuk/[email protected] | ||
with: | ||
path: './gradle.properties' | ||
property: 'mod_id' | ||
- name: Read mod version from gradle.properties | ||
id: mod_version | ||
uses: Reedyuk/[email protected] | ||
with: | ||
path: './gradle.properties' | ||
property: 'mod_version' | ||
- name: Read minecraft version from gradle.properties | ||
id: mc_version | ||
uses: Reedyuk/[email protected] | ||
with: | ||
path: './gradle.properties' | ||
property: 'minecraft_version' | ||
- name: Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.gradle/caches | ||
key: gradle-minecraft-${{ steps.mc_version.outputs.value }} | ||
- name: Make gradlew executable | ||
run: chmod +x ./gradlew | ||
- name: Build and Publish | ||
env: | ||
GPR_USER: "MrCrayfish" | ||
GPR_KEY: ${{ secrets.GPR_TOKEN }} | ||
SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | ||
SIGNING_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
run: ./gradlew build | ||
- name: Stop Gradle | ||
run: ./gradlew --stop | ||
- name: Construct artifact files | ||
id: artifacts | ||
run: | | ||
echo "common=common/build/libs/${{ steps.mod_id.outputs.value }}-common-${{ steps.mc_version.outputs.value }}-${{ steps.mod_version.outputs.value }}.jar" >> "$GITHUB_OUTPUT" | ||
- name: Import GPG | ||
env: | ||
SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | ||
SIGNING_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
if: ${{ env.SIGNING_KEY != '' && env.SIGNING_PASSPHRASE != '' }} | ||
uses: crazy-max/[email protected] | ||
with: | ||
gpg_private_key: ${{ env.SIGNING_KEY }} | ||
passphrase: ${{ env.SIGNING_PASSPHRASE }} | ||
- name: Sign JAR | ||
env: | ||
SIGNING_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
if: ${{ env.SIGNING_PASSPHRASE != '' }} | ||
run: | | ||
gpg --batch --yes --passphrase "${{ env.SIGNING_PASSPHRASE }}" --armor --detach-sign ${{ steps.artifacts.outputs.common }} | ||
- name: Upload Common Artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: '${{ steps.mod_id.outputs.value }}-common-${{ steps.mc_version.outputs.value }}-${{ steps.mod_version.outputs.value }}' | ||
path: | | ||
${{ steps.artifacts.outputs.common }} | ||
${{ steps.artifacts.outputs.common }}.asc |
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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Build and Sign Mod | ||
on: | ||
push: | ||
paths: | ||
- 'release_build_fabric' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: Build | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Read modid from gradle.properties | ||
id: mod_id | ||
uses: Reedyuk/[email protected] | ||
with: | ||
path: './gradle.properties' | ||
property: 'mod_id' | ||
- name: Read mod version from gradle.properties | ||
id: mod_version | ||
uses: Reedyuk/[email protected] | ||
with: | ||
path: './gradle.properties' | ||
property: 'mod_version' | ||
- name: Read minecraft version from gradle.properties | ||
id: mc_version | ||
uses: Reedyuk/[email protected] | ||
with: | ||
path: './gradle.properties' | ||
property: 'minecraft_version' | ||
- name: Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.gradle/caches | ||
key: gradle-minecraft-${{ steps.mc_version.outputs.value }} | ||
- name: Make gradlew executable | ||
run: chmod +x ./gradlew | ||
- name: Run Data Generation | ||
env: | ||
GPR_USER: "MrCrayfish" | ||
GPR_KEY: ${{ secrets.GPR_TOKEN }} | ||
SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | ||
SIGNING_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
TARGET_LOADER: "fabric" | ||
run: ./gradlew :fabric:runDatagen | ||
- name: Build and Publish | ||
env: | ||
GPR_USER: "MrCrayfish" | ||
GPR_KEY: ${{ secrets.GPR_TOKEN }} | ||
SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | ||
SIGNING_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
TARGET_LOADER: "fabric" | ||
run: ./gradlew build | ||
- name: Stop Gradle | ||
run: ./gradlew --stop | ||
- name: Construct artifact files | ||
id: artifacts | ||
run: | | ||
echo "fabric=fabric/build/libs/${{ steps.mod_id.outputs.value }}-fabric-${{ steps.mc_version.outputs.value }}-${{ steps.mod_version.outputs.value }}.jar" >> "$GITHUB_OUTPUT" | ||
- name: Import GPG | ||
env: | ||
SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | ||
SIGNING_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
if: ${{ env.SIGNING_KEY != '' && env.SIGNING_PASSPHRASE != '' }} | ||
uses: crazy-max/[email protected] | ||
with: | ||
gpg_private_key: ${{ env.SIGNING_KEY }} | ||
passphrase: ${{ env.SIGNING_PASSPHRASE }} | ||
- name: Sign JAR | ||
env: | ||
SIGNING_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
if: ${{ env.SIGNING_PASSPHRASE != '' }} | ||
run: | | ||
gpg --batch --yes --passphrase "${{ env.SIGNING_PASSPHRASE }}" --armor --detach-sign ${{ steps.artifacts.outputs.fabric }} | ||
- name: Upload Fabric Artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: '${{ steps.mod_id.outputs.value }}-fabric-${{ steps.mc_version.outputs.value }}-${{ steps.mod_version.outputs.value }}' | ||
path: | | ||
${{ steps.artifacts.outputs.fabric }} | ||
${{ steps.artifacts.outputs.fabric }}.asc |
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
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 |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: Build and Sign Mod | ||
on: | ||
push: | ||
paths: | ||
- 'release_build_neoforge' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: Build | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Read modid from gradle.properties | ||
id: mod_id | ||
uses: Reedyuk/[email protected] | ||
with: | ||
path: './gradle.properties' | ||
property: 'mod_id' | ||
- name: Read mod version from gradle.properties | ||
id: mod_version | ||
uses: Reedyuk/[email protected] | ||
with: | ||
path: './gradle.properties' | ||
property: 'mod_version' | ||
- name: Read minecraft version from gradle.properties | ||
id: mc_version | ||
uses: Reedyuk/[email protected] | ||
with: | ||
path: './gradle.properties' | ||
property: 'minecraft_version' | ||
- name: Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.gradle/caches | ||
key: gradle-minecraft-${{ steps.mc_version.outputs.value }} | ||
- name: Load Keystore | ||
id: load_keystore | ||
env: | ||
JKS: ${{ secrets.MRCRAYFISH_JKS }} | ||
if: ${{ env.JKS != '' }} | ||
uses: timheuer/[email protected] | ||
with: | ||
fileName: 'keystore.jks' | ||
encodedString: ${{ env.JKS }} | ||
- name: Make gradlew executable | ||
run: chmod +x ./gradlew | ||
- name: Run Data Generation | ||
env: | ||
GPR_USER: "MrCrayfish" | ||
GPR_KEY: ${{ secrets.GPR_TOKEN }} | ||
SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | ||
SIGNING_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
TARGET_LOADER: "neoforge" | ||
run: ./gradlew :neoforge:runData | ||
- name: Build and Publish | ||
env: | ||
GPR_USER: "MrCrayfish" | ||
GPR_KEY: ${{ secrets.GPR_TOKEN }} | ||
SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | ||
SIGNING_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
KEYSTORE: ${{ steps.load_keystore.outputs.filePath }} | ||
KEYSTORE_ALIAS: ${{ secrets.MRCRAYFISH_JKS_ALIAS }} | ||
KEYSTORE_PASS: ${{ secrets.MRCRAYFISH_JKS_PASSPHRASE }} | ||
TARGET_LOADER: "neoforge" | ||
run: ./gradlew build | ||
- name: Stop Gradle | ||
run: ./gradlew --stop | ||
- name: Construct artifact files | ||
id: artifacts | ||
run: | | ||
echo "neoforge=neoforge/build/libs/${{ steps.mod_id.outputs.value }}-neoforge-${{ steps.mc_version.outputs.value }}-${{ steps.mod_version.outputs.value }}.jar" >> "$GITHUB_OUTPUT" | ||
- name: Import GPG | ||
env: | ||
SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | ||
SIGNING_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
if: ${{ env.SIGNING_KEY != '' && env.SIGNING_PASSPHRASE != '' }} | ||
uses: crazy-max/[email protected] | ||
with: | ||
gpg_private_key: ${{ env.SIGNING_KEY }} | ||
passphrase: ${{ env.SIGNING_PASSPHRASE }} | ||
- name: Sign JAR | ||
env: | ||
SIGNING_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
if: ${{ env.SIGNING_PASSPHRASE != '' }} | ||
run: | | ||
gpg --batch --yes --passphrase "${{ env.SIGNING_PASSPHRASE }}" --armor --detach-sign ${{ steps.artifacts.outputs.neoforge }} | ||
- name: Upload Forge Artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: '${{ steps.mod_id.outputs.value }}-neoforge-${{ steps.mc_version.outputs.value }}-${{ steps.mod_version.outputs.value }}' | ||
path: | | ||
${{ steps.artifacts.outputs.neoforge }} | ||
${{ steps.artifacts.outputs.neoforge }}.asc |