-
Notifications
You must be signed in to change notification settings - Fork 6
55 lines (53 loc) · 1.51 KB
/
build-library-jar.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
name: Build and Release Library
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build-library:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Change wrapper permissions
run: chmod +x pi4micronaut-utils/gradlew
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build
build-root-directory: pi4micronaut-utils/
- name: Execute Gradle build
working-directory: pi4micronaut-utils
run: ./gradlew shadowJar
publish-jar:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
if: github.event_name == 'workflow_dispatch'
needs: build-library
steps:
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Change wrapper permissions
run: chmod +x pi4micronaut-utils/gradlew
- name: Publish Library
working-directory: pi4micronaut-utils
env:
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
run: ./gradlew clean publish --info