Skip to content

Merge pull request #168 from MinimallyCorrect/renovate/org.shipkit.sh… #459

Merge pull request #168 from MinimallyCorrect/renovate/org.shipkit.sh…

Merge pull request #168 from MinimallyCorrect/renovate/org.shipkit.sh… #459

Workflow file for this run

# 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: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
verify-gradle-wrapper:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
- uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2.1.1
build:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
runs-on: ubuntu-latest
strategy:
matrix:
jdk: [11, 15]
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-jdk-${{ matrix.jdk }}-gradlewrapper-${{ hashFiles('**/gradle-wrapper.properties') }}-gradlescripts-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-jdk-${{ matrix.jdk }}-gradlewrapper-${{ hashFiles('**/gradle-wrapper.properties') }}-gradlescripts-
- name: Set up JDK
uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2
with:
distribution: 'adopt'
java-version: ${{ matrix.jdk }}
- run: chmod +x gradlew
- run: ./gradlew build --stacktrace --warning-mode all
release:
runs-on: ubuntu-latest
needs: [build, verify-gradle-wrapper] # build job must pass before we can release
if: github.event_name == 'push'
&& github.ref == 'refs/heads/main'
&& github.repository == 'MinimallyCorrect/DefaultsPlugin'
&& !contains(toJSON(github.event.commits.*.message), '[skip release]')
steps:
- name: Check out code
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
with:
fetch-depth: '0' # https://github.com/shipkit/shipkit-changelog#fetch-depth-on-ci
- name: Set up Java 11
uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2
with:
distribution: 'adopt'
java-version: 11
- name: Build and publish to github
run: ./gradlew -P releasing publish publishPlugins githubRelease -s
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GRADLE_PUBLISH_KEY: ${{secrets.GRADLE_PUBLISH_KEY}}
GRADLE_PUBLISH_SECRET: ${{secrets.GRADLE_PUBLISH_SECRET}}
DEPLOYMENT_REPO_URL_RELEASE: ${{secrets.DEPLOYMENT_REPO_URL_RELEASE}}
DEPLOYMENT_REPO_URL_SNAPSHOT: ${{secrets.DEPLOYMENT_REPO_URL_SNAPSHOT}}
DEPLOYMENT_REPO_USERNAME: ${{secrets.DEPLOYMENT_REPO_USERNAME}}
DEPLOYMENT_REPO_PASSWORD: ${{secrets.DEPLOYMENT_REPO_PASSWORD}}