Skip to content

[Issue-162] Update for retrieving new spark version (#163) #137

[Issue-162] Update for retrieving new spark version (#163)

[Issue-162] Update for retrieving new spark version (#163) #137

Workflow file for this run

name: build
on: [push, pull_request, workflow_dispatch]
# workflow_dispatch should make manually triggered ci/cd possible
# workflow file (like this) with `workflow_dispatch` after on should exist on the **master** or default branch,
# or there will be no ui for a manual trigger. https://gh.neting.ccmunity/t/workflow-dispatch-event-not-working/128856/2
env:
GRADLE_OPTS: "-Xms128m -Xmx1024m"
ORG_GRADLE_PROJECT_logOutput: true
SPARK_LOCAL_IP: "127.0.0.1"
jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: '11' # major or semver Java version will be acceptable, see https://github.com/marketplace/actions/setup-java-jdk#basic
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
architecture: x64 # (x64 or x86) - defaults to x64
- name: Cache gradle modules
uses: actions/cache@v2
with:
# gradle packages that need to be cached
path: |
.gradle
$HOME/.gradle
$HOME/.m2
# key to identify the specific cache
# so if we upgrade some modules, the key(hash) of `gradle.properties` will change
# and we will rerun the download to get the newest packages
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
# build cache is used when we need to publish the artifact
- name: Cache build outputs
uses: actions/cache@v2
with:
path: ./*
key: ${{ github.run_id }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build via Gradle
run: ./gradlew clean build
snapshot:
name: Publish snapshot to Github Packages
needs: [build]
runs-on: ubuntu-20.04
# only publish the snapshot when it is a push on the master or the release branch (starts with r0.x or r1.x)
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/r0.') || startsWith(github.ref, 'refs/heads/r1.')) }}
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
steps:
# see comments above
- name: Cache gradle modules
uses: actions/cache@v2
with:
path: |
.gradle
$HOME/.gradle
$HOME/.m2
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
# see comments above
- name: Cache build outputs
uses: actions/cache@v2
with:
path: ./*
key: ${{ github.run_id }}
- name: Publish to Github Packages
run: ./gradlew publishToRepo -PpublishUrl=https://maven.pkg.github.com/${{github.repository}} -PpublishUsername=${{github.actor}} -PpublishPassword=${{secrets.GITHUB_TOKEN}}