Skip to content

Commit 3e108e4

Browse files
committed
fix(CI): added github actions
Signed-off-by: Sridhar G K <gksridhar09@gmail.com>
1 parent 903f742 commit 3e108e4

1 file changed

Lines changed: 141 additions & 0 deletions

File tree

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: Build & Release
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
tags: ['**']
7+
pull_request:
8+
branches: ['**']
9+
workflow_dispatch:
10+
# Allow workflow to be triggered manually.
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
build-test:
17+
name: Build and Test
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up JDK 17
25+
uses: actions/setup-java@v4
26+
with:
27+
java-version: '17'
28+
distribution: 'temurin'
29+
cache: 'maven'
30+
31+
- name: Set Maven version
32+
run: build/setMavenVersion.sh
33+
34+
- name: Build and test
35+
run: mvn verify -fae -DskipITs --settings build/.travis.settings.xml
36+
37+
- name: Publish code coverage
38+
if: success()
39+
run: build/publishCodeCoverage.sh
40+
41+
semantic-release:
42+
name: Semantic Release
43+
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
44+
needs: build-test
45+
runs-on: ubuntu-latest
46+
permissions:
47+
contents: write
48+
49+
steps:
50+
- name: Checkout repository
51+
uses: actions/checkout@v4
52+
with:
53+
persist-credentials: false
54+
fetch-depth: 0
55+
56+
- name: Setup Node.js
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: '20'
60+
61+
- name: Setup Python
62+
uses: actions/setup-python@v5
63+
with:
64+
python-version: '3.8'
65+
66+
- name: Install Publishing Tools
67+
run: |
68+
pip install bump2version
69+
npm install @semantic-release/changelog
70+
npm install @semantic-release/exec
71+
npm install @semantic-release/git
72+
npm install @semantic-release/github
73+
74+
- name: Run semantic-release
75+
env:
76+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
run: npx semantic-release
79+
80+
publish-javadoc:
81+
name: Publish Javadoc
82+
if: startsWith(github.ref, 'refs/tags/')
83+
needs: build-test
84+
runs-on: ubuntu-latest
85+
permissions:
86+
contents: write
87+
88+
steps:
89+
- name: Checkout repository
90+
uses: actions/checkout@v4
91+
92+
- name: Set up JDK 17
93+
uses: actions/setup-java@v4
94+
with:
95+
java-version: '17'
96+
distribution: 'temurin'
97+
cache: 'maven'
98+
99+
- name: Set Maven version
100+
run: build/setMavenVersion.sh
101+
102+
- name: Generate Javadoc
103+
run: mvn clean javadoc:aggregate --settings build/.travis.settings.xml
104+
105+
- name: Publish Javadoc to gh-pages
106+
run: build/publishJavadoc.sh
107+
108+
publish-maven-central:
109+
name: Publish to Maven Central
110+
if: startsWith(github.ref, 'refs/tags/')
111+
needs: build-test
112+
runs-on: ubuntu-latest
113+
permissions:
114+
contents: read
115+
116+
steps:
117+
- name: Checkout repository
118+
uses: actions/checkout@v4
119+
120+
- name: Set up JDK 17
121+
uses: actions/setup-java@v4
122+
with:
123+
java-version: '17'
124+
distribution: 'temurin'
125+
cache: 'maven'
126+
127+
- name: Setup signing
128+
env:
129+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
130+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
131+
run: build/setupSigning.sh
132+
133+
- name: Set Maven version
134+
run: build/setMavenVersion.sh
135+
136+
- name: Deploy to Maven Central
137+
env:
138+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
139+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
140+
run: mvn deploy --settings build/.travis.settings.xml -DskipTests -P central
141+

0 commit comments

Comments
 (0)