-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (66 loc) · 1.86 KB
/
build.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: build
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
env:
GRADLE_OPTS: "-Dorg.gradle.workers.max=2 -Dorg.gradle.console=plain"
jobs:
# Verifies all tests pass
verify:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 17
cache: gradle
- uses: taiki-e/install-action@v2
with:
tool: just@1
- run: just verify
- run: ./gradlew publishPlugins -Pversion=0.0.0 --validate-only
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
# Prepare a release PR or release
release:
needs: verify
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
released: ${{ steps.release.outputs.release_created }}
steps:
- id: release
uses: googleapis/release-please-action@v4
with:
release-type: simple
# Publish the artifacts (only if `verify` passed, and `release` created release)
publish:
needs: [verify, release]
if: ${{ needs.verify.result == 'success' && needs.release.outputs.released }}
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 17
cache: gradle
- uses: taiki-e/install-action@v2
with:
tool: just@1
- run: just publish
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}