Skip to content

Commit

Permalink
Switch to GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
fr1kin committed Apr 19, 2021
1 parent 6431a08 commit ce0d9c6
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 42 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: build

on: [ push, pull_request ]

jobs:
build:
runs-on: ubuntu-20.04
outputs:
mc-version: ${{ steps.gradle.outputs.mc-version }}
forgehax-tag: ${{ steps.gradle.outputs.forgehax-tag }}
forgehax-version: ${{ steps.gradle.outputs.forgehax-version }}
forge-version: ${{ steps.gradle.outputs.forge-version }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache .gradle/caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Cache .gradle/wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-wrapper-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Gradle build
id: gradle
run: ./gradlew setupActionsOutputs clean build
- uses: actions/upload-artifact@v2
with:
name: ${{ steps.gradle.outputs.forgehax-version }}
path: build/libs/ForgeHax*.jar
retention-days: 7
release:
runs-on: ubuntu-20.04
needs: build
if: github.ref == 'refs/heads/1.16'
steps:
- uses: actions/download-artifact@v2
with:
name: ${{ needs.build.outputs.forgehax-version }}
path: jars/
- uses: papeloto/action-zip@v1
with:
recursive: false
files: jars/
dest: Release.zip
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: Release.zip
tag: ${{ needs.build.outputs.mc-version }}-${{ needs.build.outputs.forgehax-tag }}
commit: ${{ github.sha }}
name: ForgeHax ${{ needs.build.outputs.forgehax-version }} for Minecraft ${{ needs.build.outputs.mc-version }}
body: Built using Forge MDK version ${{ needs.build.outputs.forge-version }}
token: ${{ secrets.GITHUB_TOKEN }}
30 changes: 0 additions & 30 deletions Jenkinsfile

This file was deleted.

12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# ForgeHax
![](logo.png)

[![](https://img.shields.io/badge/download-1.12.x%20latest-blue.svg?logo=java)](https://jenkins.nhackindustries.com/job/ForgeHax/job/master/lastSuccessfulBuild/)
[![](https://img.shields.io/badge/download-1.15.x%20latest-blue.svg?logo=java)](https://jenkins.nhackindustries.com/job/ForgeHax/job/1.15/lastSuccessfulBuild/artifact/build/libs/)
[![](https://img.shields.io/badge/download-1.16.x%20latest-blue.svg?logo=java)](https://jenkins.nhackindustries.com/job/ForgeHax/job/1.16/lastSuccessfulBuild/artifact/build/libs/)

[![Build Status](https://jenkins.nhackindustries.com/buildStatus/icon?job=ForgeHax/1.16)](https://jenkins.nhackindustries.com/job/ForgeHax/job/1.16)
[![](https://img.shields.io/github/downloads/fr1kin/ForgeHax/total)](https://github.com/fr1kin/ForgeHax/releases)
[![](https://img.shields.io/matrix/forgehax:nerdsin.space.svg?label=%23forgehax%3Anerdsin.space&logo=matrix)](https://matrix.to/#/#forgehax:nerdsin.space)

![Build Status](https://github.com/fr1kin/ForgeHax/actions/workflows/ci.yml/badge.svg?branch=1.16)

A Minecraft cheat that runs as a Forge mod.

## Installing

1. Download the latest version of [Minecraft Forge](https://files.minecraftforge.net/) for the corresponding
ForgeHax Minecraft version (this is important if you want to run older versions of ForgeHax).
2. Download the latest ForgeHax build by clicking the desired version badge shown above.
Do NOT install the jar that ends with `-sources.jar`. That one contains the source code and isn't compiled.
2. Download the latest ForgeHax build by going to the [releases](https://github.com/fr1kin/ForgeHax/releases) section.
Do NOT install the jar that contains `sources`. That one contains the source code and isn't compiled.
3. Place the ForgeHax jar into the `.minecraft/mods/` directory. If you want to organize by Minecraft version,
you can place it under `.minecraft/mods/{mc.version}` where `mc.version` is
the version of Minecraft running (ex: `.minecraft/mods/1.12.2`). NOTE: This is will not work for 1.13+ version! You can
Expand Down
19 changes: 14 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ ext {
}
}.call()

forgehaxVersion = "3.3.0-${forgehaxCommit}"
forgehaxTag = '3.3.0'
forgehaxVersion = "${forgehaxTag}-${forgehaxCommit}"

minecraftVersion = '1.16.5'
forgeVersion = '36.0.13'
Expand Down Expand Up @@ -60,10 +61,10 @@ configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

final isJenkinsBuilding = 'yes' == System.getenv("JENKINS_BUILDING")
final isCiBuilding = System.getenv().containsKey('CI')

if (isJenkinsBuilding) {
logger.warn 'Jenkins detected. Certain modules will be omitted from this build'
if (isCiBuilding) {
logger.warn 'CI build. Certain modules will be omitted from this build'
}

sourceSets {
Expand All @@ -72,7 +73,7 @@ sourceSets {
}

main {
if (isJenkinsBuilding) {
if (isCiBuilding) {
java {
exclude 'dev/fiki/forgehax/main/mods/ForgeModListSpoofer.java'
}
Expand Down Expand Up @@ -231,4 +232,12 @@ task copyJar(type: DefaultTask, dependsOn: [setGameDir]) {
}
}

task setupActionsOutputs() {
println 'GitHub Actions outputs'
println "::set-output name=mc-version::${minecraftVersion}"
println "::set-output name=forgehax-tag::${forgehaxTag}"
println "::set-output name=forgehax-version::${forgehaxVersion}"
println "::set-output name=forge-version::${forgeVersion}"
}

build.finalizedBy copyJar

0 comments on commit ce0d9c6

Please sign in to comment.