-
Notifications
You must be signed in to change notification settings - Fork 43
57 lines (49 loc) · 1.72 KB
/
spring-search-deploy.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
56
57
name: SpringSearch Deploy
on:
pull_request:
types:
- closed
branches:
- master
env:
TAG_NAME: ${{ github.event.pull_request.title }}
jobs:
release-maven-central:
if: contains(github.head_ref, 'bump/v') && github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'
- name: Import GPG signing key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.MAVEN_SIGNING_KEY }}
passphrase: ${{ secrets.MAVEN_SIGNING_KEY_PASSPHRASE }}
- name: Install JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
server-id: maven-central-release
server-username: MVN_CENTRAL_USERNAME
server-password: MVN_CENTRAL_PASSWORD
- name: Release to Maven repo
run: mvn -Dgpg.keyname="${{ secrets.GPG_KEY_NAME }}" -Dgpg.passphrase="${{ secrets.MAVEN_SIGNING_KEY_PASSPHRASE }}" -Drevision="${{ env.TAG_NAME }}" -DnvdApiKey="{{ secrets.NVD_API_KEY }}" deploy
env:
MVN_CENTRAL_USERNAME: ${{ secrets.MVN_CENTRAL_USERNAME }}
MVN_CENTRAL_PASSWORD: ${{ secrets.MVN_CENTRAL_PASSWORD }}
- name: Push tag
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CUSTOM_TAG: ${{ env.TAG_NAME }}
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.TAG_NAME }}
generate_release_notes: true