Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #2
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 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 | |
# This workflow should have the same content as build-project.yaml, plus extra handling for publishing | |
name: Build and Deploy | |
on: | |
push: | |
branches: [ "*"] | |
tags-ignore: [ "*" ] | |
pull_request: | |
release: | |
types: [ released ] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
${{ github.workspace}}/buildSrc/.gradle/ | |
${{ github.workspace}}/forge/build/fg_cache | |
${{ github.workspace}}/.gradle/ | |
key: "${{ runner.os }}-minecraft-${{ hashFiles('**/*.gradle*') }}" | |
restore-keys: | | |
${{ runner.os }}-minecraft- | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Setup workspace | |
run: | | |
echo "GIT_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV | |
echo "GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
echo "BUILD_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV | |
- name: Build with Gradle | |
run: ./gradlew -PenableTestPlugins=true build --stacktrace | |
env: | |
CI_SYSTEM: Github Actions | |
- name: Server Jar | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Server Jar | |
path: "${{ github.workspace }}/vanilla/build/libs/*-universal.jar" | |
integrationTest: | |
needs: build | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, windows-latest, macos-latest] | |
java: [8, 11, 16] | |
runs-on: "${{ matrix.os }}" | |
steps: | |
- name: Check out repository to use the build.gradle.kts as a hash file | |
uses: actions/checkout@v2 | |
with: | |
path: code | |
- name: "Setup JDK ${{ matrix.java }}" | |
uses: actions/setup-java@v1 | |
with: | |
java-version: "${{ matrix.java }}" | |
- uses: actions/cache@v2 | |
with: | |
path: "${{ github.workspace}}/libraries" | |
key: "${{runner.os}}-${{matrix.java}}-it-libraries-${{ hashFiles('code/build.gradle.kts') }}" | |
restore-keys: "${{runner.os}}-${{matrix.java}}-it-libraries-" | |
- name: Download SpongeVanilla server | |
uses: actions/[email protected] | |
with: | |
name: Server Jar | |
- name: Run SpongeVanilla Test (windows) | |
if: "runner.os == 'Windows'" | |
run: java -jar $(gci | Where-Object NameString -Match "-universal.jar") --launchTarget sponge_server_it | |
- name: Run SpongeVanilla Test (other) | |
if: "runner.os != 'Windows'" | |
run: java -jar *-universal.jar --launchTarget sponge_server_it | |
publish: | |
needs: integrationTest | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
${{ github.workspace}}/buildSrc/.gradle/ | |
${{ github.workspace}}/forge/build/fg_cache | |
${{ github.workspace}}/.gradle/ | |
key: "${{ runner.os }}-minecraft-${{ hashFiles('**/*.gradle*') }}" | |
restore-keys: | | |
${{ runner.os }}-minecraft- | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
# We don't need to run tests again, so we just publish | |
- name: Setup workspace | |
run: | | |
echo "GIT_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV | |
echo "GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
echo "BUILD_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV | |
- name: Publish to Sponge Maven & GitHub Packages | |
run: ./gradlew -s :publish :SpongeVanilla:publish | |
env: | |
CI_SYSTEM: Github Actions | |
GITHUB_USERNAME: "${{ github.actor }}" | |
GITHUB_TOKEN: "${{ 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 }}" |