Skip to content

Commit 99ea5da

Browse files
authored
Merge pull request #18 from securenative/dev
Added publish to maven workflow
2 parents 87655e1 + 0180866 commit 99ea5da

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/publish.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Notify Starting
12+
if: success()
13+
id: slack # IMPORTANT: reference this step ID value in future Slack steps
14+
env:
15+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
16+
uses: voxmedia/[email protected]
17+
with:
18+
channel: github-actions
19+
status: STARTING
20+
color: warning
21+
22+
- uses: actions/checkout@v2
23+
- name: Set up Maven Central Repository
24+
uses: actions/setup-java@v1
25+
with:
26+
java-version: 1.8
27+
server-id: ossrh
28+
server-username: MAVEN_USERNAME
29+
server-password: MAVEN_PASSWORD
30+
31+
- name: Build
32+
run: mvn -B package --file pom.xml
33+
34+
- name: Run Tests
35+
run: mvn test
36+
37+
- name: Publish package
38+
run: mvn -B deploy
39+
env:
40+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
41+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
42+
43+
- name: Notify slack success
44+
if: success()
45+
env:
46+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
47+
uses: voxmedia/[email protected]
48+
with:
49+
message_id: ${{ steps.slack.outputs.message_id }}
50+
channel: github-actions
51+
status: SUCCESS
52+
color: good
53+
54+
- name: Notify slack fail
55+
if: failure()
56+
env:
57+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
58+
uses: voxmedia/[email protected]
59+
with:
60+
message_id: ${{ steps.slack.outputs.message_id }}
61+
channel: github-actions
62+
status: FAILED
63+
color: danger

0 commit comments

Comments
 (0)