-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (68 loc) · 2.17 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
66
67
68
name: Grace CI
on:
push:
branches:
- 2023.1.x
pull_request:
branches:
- 2023.1.x
workflow_dispatch:
jobs:
build:
if: ${{ github.repository == 'graceframework/grace-framework' }}
permissions:
contents: read # to fetch code (actions/checkout)
runs-on: ubuntu-22.04
strategy:
matrix:
java: ['17']
env:
WORKSPACE: ${{ github.workspace }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Run Build
id: build
uses: gradle/actions/setup-gradle@v3
with:
arguments: build -x codenarcMain -x codenarcTest -x checkstyleMain -x checkstyleTest
publish:
if: github.event_name == 'push'
needs: ["build"]
permissions:
contents: read # to fetch code (actions/checkout)
checks: write
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Generate secring file
env:
SECRING_FILE: ${{ secrets.SECRING_FILE }}
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
- name: Publish to Sonatype OSSRH
id: publish
uses: gradle/actions/setup-gradle@v3
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_NEXUS_URL: ${{ secrets.SONATYPE_NEXUS_URL }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SECRING_FILE: ${{ secrets.SECRING_FILE }}
with:
arguments: -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg publishToSonatype closeAndReleaseSonatypeStagingRepository