-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (56 loc) · 1.84 KB
/
Copy pathbuild.yml
File metadata and controls
66 lines (56 loc) · 1.84 KB
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
name: Build
on:
workflow_dispatch:
inputs:
release-please:
description: Execute Release Please Action
required: true
type: boolean
default: false
publish:
description: Publish to Central Repository
required: true
type: boolean
default: false
push:
branches:
- master
permissions:
contents: write
issues: write
pull-requests: write
concurrency:
group: release-${{ github.ref }}
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Gradle
uses: ./.github/actions/setup-gradle
- name: Build and Scan
run: ./gradlew build sonar -Pstrict
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Create Release Pull Request
id: release
if: github.event_name != 'workflow_dispatch' || inputs.release-please
uses: googleapis/release-please-action@v5
- name: Publish to Central Repository
if: github.event_name != 'workflow_dispatch' || inputs.publish
run: ./gradlew publish
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.GPG_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }}
- name: Upload Release Artifacts
if: ${{ steps.release.outputs.release_created }}
run: gh release upload "$TAG" build/libs/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.release.outputs.tag_name }}