Skip to content

Update gradle/gradle-build-action action to v3 - autoclosed #136

Update gradle/gradle-build-action action to v3 - autoclosed

Update gradle/gradle-build-action action to v3 - autoclosed #136

Workflow file for this run

#
# CI build that assembles artifacts and runs tests.
# If validation is successful this workflow releases from the main dev branch.
#
# - skipping CI: add [skip ci] to the commit message
# - skipping release: add [skip release] to the commit message
#
name: CI
permissions: read-all
on:
push:
branches: ['main']
tags-ignore: [v*] # release tags are autogenerated after a successful CI, no need to run CI against them
pull_request:
branches: ['**']
jobs:
gradle_wrapper_validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 # docs: https://github.com/actions/checkout
with:
fetch-depth: '0' # https://github.com/shipkit/shipkit-auto-version#fetch-depth-on-ci
- name: Gradle wrapper validation
uses: gradle/[email protected]
build:
runs-on: ubuntu-latest
needs: [ gradle_wrapper_validation ]
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v3 # https://github.com/actions/checkout
with:
fetch-depth: '0' # https://github.com/shipkit/shipkit-changelog#fetch-depth-on-ci
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Perform Build via Gradle
uses: gradle/gradle-build-action@v3
with:
arguments: build --scan
- name: Publish to Maven Local via Gradle
uses: gradle/gradle-build-action@v3
with:
arguments: publishToMavenLocal --scan
- name: Upload CodeCov Report
uses: codecov/codecov-action@v3
with:
files: "**/build/reports/jacoco/**/*.xml"
- name: Publish Plugin and Create GitHub Release via Gradle
uses: gradle/gradle-build-action@v3
# Release job, only for pushes to the main development branch
if: github.event_name == 'push'
&& github.ref == 'refs/heads/main'
&& github.repository == 'MythicDrops/mythicdrops-gradle-plugin'
&& !contains(toJSON(github.event.commits.*.message), '[skip release]')
with:
arguments: publishPlugins githubRelease --scan
env:
# Gradle env variables docs: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_environment_variables
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_k2:
runs-on: ubuntu-latest
needs: [ gradle_wrapper_validation ]
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v3 # https://github.com/actions/checkout
with:
fetch-depth: '0' # https://github.com/shipkit/shipkit-changelog#fetch-depth-on-ci
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Perform Build via Gradle
uses: gradle/gradle-build-action@v3
with:
arguments: build --scan -Pkotlin.experimental.tryK2=true