-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (49 loc) · 1.65 KB
/
publish.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
---
name: Publish
on: # yamllint disable-line rule:truthy
push:
tags:
- "*.*.*"
jobs:
publish:
name: Publish
permissions:
contents: write
packages: write
strategy:
matrix:
os: [ubuntu-latest] # Just one
java: [11] # Just one
gradle: [wrapper] # Just one
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- name: Setup Gradle ${{ matrix.gradle }}
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{ matrix.gradle }}
build-scan-publish: false # Might contain private keys or sensitive information
- name: Publish to Maven Central
run: |
gradle assemble publish closeAndReleaseSonatypeStagingRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
- name: Release on GitHub
uses: softprops/action-gh-release@v2
with:
name: "Release ${{ github.ref_name }}"
files: "**/build/libs/commons-configuration2-jackson-${{ github.ref_name }}*"
fail_on_unmatched_files: true