Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Update SpongeForge to build with GitHub Actions
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Harris-Rouquette <[email protected]>
  • Loading branch information
gabizou committed Oct 16, 2020
1 parent cd82ddb commit c131590
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 6 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
pull_request:
branches: [ stable-7 ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
${{ github.workspace }}/.gradle/minecraft
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup decompiled workspace
run: ./gradlew setupDecompWorkspace
- name: Build with Gradle
run: ./gradlew build
- name: Archive artifacts for build
uses: actions/upload-artifact@v2
with:
name: Sponge Jars
path: |
${{ github.workspace }}/SpongeAPI/build/libs/*.jar
${{ github.workspace }}/build/libs/*.jar
36 changes: 36 additions & 0 deletions .github/workflows/check-license.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: License Check

on:
push:
branches: [ stable-7 ]
pull_request:
branches: [ stable-7 ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
${{ github.workspace }}/.gradle/minecraft
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew checkLicenses
64 changes: 64 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Build and Deploy

on:
push:
branches: [ stable-7 ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
${{ github.workspace }}/.gradle/minecraft
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: run number with offset
run: echo "BUILD_NUMBER=$(($GITHUB_RUN_NUMBER+4082))" >> $GITHUB_ENV
- name: Setup workspace
run : |
echo "GIT_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV
echo "GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
./gradlew --refresh-dependencies setupDecompWorkspace
- name: Build with Gradle
run: |
./gradlew -s build
env:
CI_SYSTEM: Github Actions
- name: Add artifacts to build
uses: actions/upload-artifact@v2
with:
name: Sponge Jars
path: |
${{ github.workspace }}/SpongeCommon/SpongeAPI/build/libs/*.jar
${{ github.workspace }}/SpongeCommon/build/libs/*.jar
${{ github.workspace }}/build/libs/*.jar
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# the publishing section of your build.gradle
- name: Publish to Sponge Maven & GitHub Packages
run: ./gradlew :uploadArchives
env:
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_spongeRepo: ${{ secrets.SPONGE_INDEXER_URL }}
ORG_GRADLE_PROJECT_spongeSnapshotRepo: ${{ secrets.SPONGE_MAVEN_SNAPSHOT_REPO_URL }}
ORG_GRADLE_PROJECT_spongeReleaseRepo: ${{ secrets.SPONGE_MAVEN_RELEASE_REPO_URL }}
ORG_GRADLE_PROJECT_spongeUsername: ${{ secrets.SPONGE_INDEXER_USERNAME }}
ORG_GRADLE_PROJECT_spongePassword: ${{ secrets.SPONGE_INDEXER_PASSWORD }}


10 changes: 10 additions & 0 deletions .github/workflows/gradle-wrapper-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "Validate Gradle Wrapper"
on: [push, pull_request]

jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
2 changes: 1 addition & 1 deletion SpongeCommon
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Wed Apr 24 22:07:40 EDT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip
6 changes: 3 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -155,7 +155,7 @@ if $cygwin ; then
fi

# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
Expand Down

0 comments on commit c131590

Please sign in to comment.