-
Notifications
You must be signed in to change notification settings - Fork 6
61 lines (53 loc) · 1.57 KB
/
main.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
name: Axon Bill Of Materials
on:
push:
branches:
- main
- master
- axon-bom-*.*.x
jobs:
build:
name: Test and Build
runs-on: ubuntu-latest
continue-on-error: true # do not fail the whole job if one of the steps fails
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 8
cache: "maven"
server-id: sonatype
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Build
run: |
./mvnw -B -U -Dstyle.color=always verify -DskipTests=true
- name: Deploy to Sonatype
if: success()
run: |
mvn -B -U -Dstyle.color=always deploy -DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.SONATYPE_TOKEN_ID }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN_PASS }}
- name: Notify success to Slack
if: success()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v2
with:
channel_id: CAGSEC92A
status: SUCCESS
color: good
- name: Notify failure to Slack
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v2
with:
channel_id: CAGSEC92A
status: FAILED
color: danger