-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
17 additions
and
127 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 |
---|---|---|
@@ -1,34 +1,12 @@ | ||
# 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: [ master ] | ||
branches: "**" | ||
tags-ignore: ["**"] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
# Only run on PRs if the source branch is on someone else's repo | ||
if: "${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}" | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: "${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}" | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: adopt | ||
java-version: 11 | ||
- name: Build with Gradle | ||
run: ./gradlew checkLicenses | ||
call-check: | ||
uses: SpongePowered/.github/.github/workflows/shared-check-license.yaml@master | ||
secrets: inherit |
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 |
---|---|---|
|
@@ -11,80 +11,6 @@ on: | |
types: [released] | ||
|
||
jobs: | ||
build: | ||
# Only run on PRs if the source branch is on someone else's repo | ||
if: "${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}" | ||
|
||
runs-on: "${{ matrix.os }}" | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
steps: | ||
# Setup | ||
- name: Check out | ||
uses: actions/checkout@v2 | ||
- name: Setup JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: adopt | ||
java-version: 11 | ||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
|
||
# Checks branch name to see if we're going to potentially publish this | ||
- name: Check branch for publish | ||
uses: actions-ecosystem/[email protected] | ||
id: branch-name | ||
with: | ||
text: ${{ github.ref }} | ||
regex: '^refs/heads/(master|(\d+\.\d+\.x))$' # master or something like 0.8.x | ||
|
||
# Actually build | ||
- name: Build with Gradle | ||
run: ./gradlew build | ||
- name: Archive test results | ||
if: "${{ always() }}" | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: "test-results-${{ matrix.os }}" | ||
path: | | ||
build/reports | ||
*/build/reports | ||
# Then publish if we are all set up to do so | ||
- name: Determine status | ||
if: "${{ runner.os == 'Linux' }}" | ||
run: | | ||
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then | ||
echo "STATUS=snapshot" >> $GITHUB_ENV | ||
else | ||
echo "STATUS=release" >> $GITHUB_ENV | ||
fi | ||
- name: Publish with Gradle (snapshot) | ||
if: "${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && steps.branch-name.outputs.match != '' }}" | ||
run: ./gradlew -PforceSign=true publish | ||
env: | ||
ORG_GRADLE_PROJECT_githubPackagesUsername: "${{ github.actor }}" | ||
ORG_GRADLE_PROJECT_githubPackagesPassword: "${{ secrets.GITHUB_TOKEN }}" | ||
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_MAVEN_REPO_USER }}" | ||
ORG_GRADLE_PROJECT_spongePassword: "${{ secrets.SPONGE_MAVEN_REPO_PASSWORD }}" | ||
ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SPONGE_MAVEN_OSSRH_USER }}" | ||
ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SPONGE_MAVEN_OSSRH_PASSWORD }}" | ||
ORG_GRADLE_PROJECT_spongeSigningKey: "${{ secrets.SPONGE_SIGNING_KEY }}" | ||
ORG_GRADLE_PROJECT_spongeSigningPassword: "${{ secrets.SPONGE_SIGNING_PASSWORD }}" | ||
- name: Publish with Gradle (release) | ||
if: "${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'release' }}" | ||
run: ./gradlew publish | ||
env: | ||
ORG_GRADLE_PROJECT_githubPackagesUsername: "${{ github.actor }}" | ||
ORG_GRADLE_PROJECT_githubPackagesPassword: "${{ secrets.GITHUB_TOKEN }}" | ||
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_MAVEN_REPO_USER }}" | ||
ORG_GRADLE_PROJECT_spongePassword: "${{ secrets.SPONGE_MAVEN_REPO_PASSWORD }}" | ||
ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SPONGE_MAVEN_OSSRH_USER }}" | ||
ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SPONGE_MAVEN_OSSRH_PASSWORD }}" | ||
ORG_GRADLE_PROJECT_spongeSigningKey: "${{ secrets.SPONGE_SIGNING_KEY }}" | ||
ORG_GRADLE_PROJECT_spongeSigningPassword: "${{ secrets.SPONGE_SIGNING_PASSWORD }}" | ||
call-build: | ||
uses: SpongePowered/.github/.github/workflows/shared-ci.yaml@master | ||
secrets: inherit |
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
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