Repository navigation
54 lines (54 loc) · 2.43 KB
/
Copy pathrelease.yml
File metadata and controls
54 lines (54 loc) · 2.43 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
name: release
on:
push:
tags: ["v*"]
permissions: {}
jobs:
release:
runs-on: ubuntu-latest
env:
HAS_CENTRAL: ${{ secrets.MAVEN_CENTRAL_PASSWORD != '' }}
permissions:
contents: write
id-token: write
attestations: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
distribution: temurin
java-version: "17"
server-id: central
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
# Modules built on the core SDK take it from Central, or from its v0.1.2 source tag before its first Central release.
- name: Core SDK
if: ${{ github.repository != 'lucidaanalytics/lucida-java' }}
run: |
mvn -B -ntp -q dependency:get -Dartifact=io.github.lucidaanalytics:lucida:0.1.2 \
|| { git clone --depth 1 --branch v0.1.2 https://github.com/lucidaanalytics/lucida-java "$RUNNER_TEMP/lucida-java" && mvn -B -ntp -q -f "$RUNNER_TEMP/lucida-java/pom.xml" install -DskipTests; }
# jar, sources jar, javadoc jar and the pom, unsigned: these are what the GitHub Release carries.
- name: Build release files
run: |
mvn -B -ntp -P release -Dgpg.skip verify
cp pom.xml "target/lucida-java-${GITHUB_REF_NAME}.pom"
- uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
subject-path: |
target/*.jar
target/*.pom
- name: GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: gh release create "$GITHUB_REF_NAME" target/*.jar target/*.pom --generate-notes --verify-tag
# Central has no OIDC publishing: this runs only when the Portal token (MAVEN_CENTRAL_PASSWORD) is set;
# the GPG key and passwords are repository secrets too. JitPack serves the tag without any of this.
- name: Sign and publish to Maven Central
if: env.HAS_CENTRAL == 'true'
run: mvn -B -ntp -P release -DskipTests deploy
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSWORD }}