forked from oracle/coherence
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.74 KB
/
deploy-snapshots-java17.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
52
53
54
55
56
57
58
59
# This workflow will build a Java project with Maven and deploy snapshot
# artifacts to Maven Central
#
# This job is triggered by a completed run of the "CI Build" action.
# The "build" job only runs if the "CI Build" action completed successfully.
# The deployed artifacts will be built from the same commit that the "CI Build" action used.
#
name: Deploy to Maven Central (Java 17)
on:
workflow_run:
workflows: ["CI Build"]
# Only add branches that build on Java 17
branches: [ v23.03 ]
types:
- completed
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
GIT_USER: ${{ secrets.BOT_USERNAME }}
GIT_EMAIL: ${{ secrets.BOT_EMAIL }}
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false
jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: oracle-actions/setup-java@v1
with:
website: oracle.com
release: 17
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
env:
MAVEN_USER: ${{ secrets.MavenUser }}
MAVEN_PASSWORD: ${{ secrets.MavenPassword }}
GIT_COMMIT: ${{github.event.workflow_run.head_commit.id}}
HEAD_BRANCH: ${{github.event.workflow_run.head_branch}}
run: |
echo "Checking out branch ${HEAD_BRANCH} commit ${GIT_COMMIT}"
git checkout "${GIT_COMMIT}"
git config --local user.name "${GIT_USER}"
git config --local user.email "${GIT_EMAIL}"
sh tools/bin/github-deploy-snapshots.sh