-
Notifications
You must be signed in to change notification settings - Fork 16
42 lines (37 loc) · 1.21 KB
/
publish.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
name: Publish
on:
push:
tags:
- 'v*.*.*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 17 # Use Java 17 here because the Loom test env needs it
distribution: temurin
- name: Cache Gradle files
uses: actions/cache@v2
if: ${{ !env.ACT }}
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
build/loom-cache
.gradle/loom-cache
key: ${{ runner.os }}-gradle-${{ hashFiles('*/build.gradle', '*/settings.gradle', '*gradle.*') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Build with Gradle
run: ./gradlew build
env:
EXCLUDE_SUBPROJECTS: true
- name: Release Build
if: startsWith(github.ref, 'refs/tags/v')
run: ./gradlew publishPlugins -Pgradle.publish.key=$GRADLE_PUBLISH_KEY -Pgradle.publish.secret=$GRADLE_PUBLISH_SECRET
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
EXCLUDE_SUBPROJECTS: true