forked from unbroken-dome/gradle-helm-plugin
-
Notifications
You must be signed in to change notification settings - Fork 6
47 lines (40 loc) · 1.74 KB
/
publish.yaml
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
name: Plugin publish
# This workflow is strictly manual
# https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow
on:
workflow_dispatch:
permissions:
contents: read
jobs:
gradle:
strategy:
fail-fast: true
runs-on: ubuntu-latest
steps:
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle#using-the-gradle-starter-workflow
- name: Branch Check
if: github.ref != 'refs/heads/master'
uses: actions/github-script@v7
with:
script: |
core.setFailed('This workflow must run on master branch only')
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle#using-the-gradle-starter-workflow
- name: Checkout Repo
uses: actions/checkout@v4
# https://github.com/marketplace/actions/setup-java-jdk
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
# https://github.com/marketplace/actions/gradle-wrapper-validation
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v3
# https://github.com/marketplace/actions/gradle-build-action
- name: Build with Gradle
uses: gradle/gradle-build-action@v3
with:
gradle-home-cache-cleanup: true
# Secrets are uploaded via https://docs.github.com/en/actions/security-guides/encrypted-secrets
# Correct them on https://github.com/Citi/gradle-helm-plugin/settings/secrets/actions
arguments: publishPlugins -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }} --stacktrace