Repository navigation
62 lines (56 loc) · 2.71 KB
/
Copy pathreuse_java_deploy.yml
File metadata and controls
62 lines (56 loc) · 2.71 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
name: Deploy Maven
on:
workflow_call:
jobs:
publish:
if: ${{ startsWith(github.repository, 'eclipse-daanse/') && (github.ref == 'refs/heads/main') && (github.event_name != 'pull_request') }}
runs-on: ubuntu-latest
steps:
- id: install-secret-key
name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.ORG_GPG_PRIVATE_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Java for publishing to Maven Central Snapshot Repository
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
java-version: '25'
distribution: 'temurin'
cache: 'maven'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-passphrase: PASSPHRASE
- name: Restore Maven build artifacts
uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
with:
path: |
~/.m2/repository/org/eclipse/daanse
**/target
key: build-${{ runner.os }}-${{ github.sha }}
fail-on-cache-miss: true
- name: deploy
# -DskipTests only stops surefire; bnd-resolver and bnd-testing are bound to
# pre-integration-test/integration-test and still ran on every deploy.
# TEMPORARY -Dmaven.repository.credentialScope=id: Maven 3.10 (runner image)
# offers server credentials only to the origins bound to the id, and the id
# central is bound to repo.maven.apache.org, so the token never reaches
# central.sonatype.com (HTTP 401). Remove it once setup-java ships
# mvn-server-repository-origins (actions/setup-java#1282, release asked in
# actions/setup-java#1284) and set
# mvn-server-repository-origins: central:https://central.sonatype.com
run: >-
mvn -Pdeploy --no-transfer-progress --batch-mode -U deploy
-DskipTests -Dbnd.testing.skip=true -Dbnd.resolve.skip=true
-Dmaven.repository.credentialScope=id
env:
MAVEN_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}
PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }}
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
continue-on-error: true
uses: advanced-security/maven-dependency-submission-action@b275d12641ac2d2108b2cbb7598b154ad2f2cee8 # v5.0.0
with:
directory: '/'