-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (56 loc) · 1.75 KB
/
ci.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
48
49
50
51
52
53
54
55
56
name: CI
on:
pull_request:
workflow_call:
permissions: {}
jobs:
build:
name: Build
runs-on: ubuntu-24.04
timeout-minutes: 5
# actions/attest-build-provenance requires these permissions
permissions:
id-token: write
attestations: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Output SHA
uses: hudsonm62/short-sha@b5ee0a4109da599fea68b00dcfe5812100ad8d42 # v1.1.0
id: short-sha
- name: Set plugin ver with SHA commit
run: |
sed -ri "s/^(versionSuffix=).*/\1sha-${SHA}/" gradle.properties || :
env:
SHA: ${{ steps.short-sha.outputs.sha }}
- name: Set up JDK
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
java-version: 17
distribution: temurin
cache: gradle
- name: Build
run: ./gradlew jar
- name: Generate artifact attestations
uses: actions/attest-build-provenance@ef244123eb79f2f7a7e75d99086184180e6d0018 # v1.4.4
if: github.ref == 'refs/heads/main'
with:
subject-path: ./build/libs/*.jar
- name: Upload a jar
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: artifact
path: ./build/libs/
test:
name: Test
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up JDK
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
java-version: 17
distribution: temurin
cache: gradle
- name: Test
run: ./gradlew test