-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (57 loc) · 2.13 KB
/
verify.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
60
61
62
63
64
65
name: Verify Build Workflow
on:
workflow_dispatch: {}
push:
paths-ignore:
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'CODE_OF_CONDUCT*'
branches: [main]
pull_request:
paths-ignore:
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'CODE_OF_CONDUCT*'
branches: [main]
jobs:
build-verify:
name: Verify Build
runs-on: ubuntu-latest
if: github.repository_owner == 'Apicurio'
steps:
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Check Java Version
run: java -version
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: '3.8.5'
- name: Check Maven Version
run: mvn --version
- name: Checkout Code
uses: actions/checkout@v4
- name: Build Project
run: mvn clean install
- name: Slack Notification (Always)
if: github.event_name == 'push' && always()
run: |
MESSAGE="'${{ github.workflow }}/${{ github.job }}' job completed with status: ${{ job.status }}"
REPO="${{ github.repository }}"
LINK="https://github.com/$REPO/actions/runs/${{ github.run_id }}"
PAYLOAD="{\"workflow\": \"${{ github.workflow }}\", \"status\": \"${{ job.status }}\", \"message\": \"$MESSAGE\", \"link\": \"$LINK\", \"repository\": \"$REPO\"}"
curl -X POST -H "Content-Type: application/json" -d "$PAYLOAD" ${{ secrets.SLACK_NOTIFICATION_WEBHOOK }}
- name: Slack Notification (Error)
if: github.event_name == 'push' && failure()
run: |
MESSAGE="'${{ github.workflow }}/${{ github.job }}' job FAILED!"
REPO="${{ github.repository }}"
LINK="https://github.com/$REPO/actions/runs/${{ github.run_id }}"
PAYLOAD="{\"workflow\": \"${{ github.workflow }}\", \"status\": \"${{ job.status }}\", \"message\": \"$MESSAGE\", \"link\": \"$LINK\", \"repository\": \"$REPO\"}"
curl -X POST -H "Content-Type: application/json" -d "$PAYLOAD" ${{ secrets.SLACK_ERROR_WEBHOOK }}