-
Notifications
You must be signed in to change notification settings - Fork 43
72 lines (72 loc) · 3.39 KB
/
github-jdk11-release-actions.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: BULL JDK 11 Release
on:
push:
branches:
- "!*"
tags:
- "*-jdk11"
jobs:
job:
name: "BULL Release"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Cache Maven repository"
uses: actions/[email protected]
with:
path: $HOME/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: "Extract build information"
id: build_info
run: |
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
echo ::set-output name=TAG_NAME::${GITHUB_REF#refs/tags/}
- name: "Project version set"
env:
TAG_NAME: ${{ steps.build_info.outputs.TAG_NAME }}
run: |
mvn versions:set -D newVersion=${TAG_NAME}
- name: "JDK set-up"
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
server-id: oss-sonatype # Value of the distributionManagement/repository/id field of the pom.xml
server-username: SONATYPE_USERNAME # env variable for username in deploy
server-password: SONATYPE_PASSWORD # env variable for token in deploy
# only signed artifacts will be released to maven central. this sets up things for the maven-gpg-plugin
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase
settings-path: ${{ github.workspace }}
- name: "Quality check"
env:
SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn install sonar:sonar -Dsonar.projectKey=BULL -Dsonar.organization=$SONAR_ORGANIZATION -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -P compatibility-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -q
- name: "Site build"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn site:site javadoc:aggregate -P site-release -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -q -DskipTests=true
- name: "Release artifacts"
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
run: |
mvn deploy --settings $GITHUB_WORKSPACE/settings.xml -B -U -P release -DskipTests=true
- name: "Send Slack Notification"
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: releases
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: https://raw.githubusercontent.com/ExpediaGroup/bull/master/docs/site/resources/images/bell.png
SLACK_TITLE: "BULL version: ${{ steps.build_info.outputs.TAG_NAME }} available."
SLACK_MESSAGE: "<https://github.com/ExpediaGroup/bull/blob/master/CHANGELOG-JDK11.md|Check out the implemented changes in the *CHANGELOG-JDK11* file>"
SLACK_USERNAME: "bull-notifier"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_FOOTER: "Powered by BULL notifier"