-
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (57 loc) · 2.43 KB
/
gradle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#
# 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 # 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/wrapper-validation-action@8a2cbc9ccf0390177c07106bbfb02746e8f0413b # v2.1.0
build:
runs-on: ubuntu-latest
needs: [ gradle_wrapper_validation ]
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 # 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@8df1039502a15bceb9433410b1a100fbe190c53b # v4
with:
distribution: adopt
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@aff52e5be96935327d77c5529075184377dc4371 # v3
- name: Perform Build via Gradle
run: ./gradlew build publishToMavenLocal
- name: Publish Plugin and Create GitHub Release via Gradle
# 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]')
run: ./gradlew 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 }}