Skip to content

Commit 5090dad

Browse files
authored
add Github workflow and replace Gitlab publishing to Github (#3)
1 parent 1dee453 commit 5090dad

File tree

5 files changed

+66
-55
lines changed

5 files changed

+66
-55
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI Pipeline
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
name: Build with Gradle
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up JDK 21
21+
uses: actions/setup-java@v3
22+
with:
23+
distribution: 'temurin'
24+
java-version: '21'
25+
26+
- name: Grant execute permission for Gradle
27+
run: chmod +x gradlew
28+
29+
- name: Build the project
30+
run: ./gradlew build
31+
32+
publish:
33+
name: Publish to GitHub Packages
34+
runs-on: ubuntu-latest
35+
needs: build
36+
if: github.ref == 'refs/heads/master'
37+
38+
steps:
39+
- name: Checkout Repository
40+
uses: actions/checkout@v4
41+
42+
- name: Set up JDK 21
43+
uses: actions/setup-java@v3
44+
with:
45+
distribution: 'temurin'
46+
java-version: '21'
47+
48+
- name: Grant execute permission for Gradle
49+
run: chmod +x gradlew
50+
51+
- name: Publish to GitHub Packages
52+
run: ./gradlew publish
53+
env:
54+
GPR_USER: ${{ secrets.GPR_USER }}
55+
GPR_TOKEN: ${{ secrets.GPR_TOKEN }}

.gitlab-ci.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
![Checkstyle](https://img.shields.io/badge/Checkstyle-10.14.2-cyan)
99
![GitHub](https://img.shields.io/github/license/isopropylcyanide/Jwt-Spring-Security-JPA?color=blue)
1010

11-
A comprehensive common library built with Spring Boot 3.3 and Java 21, designed to streamline and standardize the development of microservices within your projects.
11+
A comprehensive common library built with **Spring Boot 3.3** and **Java 21**, designed to streamline and standardize the development of microservices within your projects.
1212

1313
`{PN}` - _project name or project name abbreviation_
1414

@@ -66,9 +66,9 @@ implementation "com.company.project:springboot-microservice-common-lib:${pnCommo
6666

6767
```xml
6868
<dependency>
69-
<groupId>com.company.project</groupId>
70-
<artifactId>springboot-microservice-common-lib</artifactId>
71-
<version>${pnCommonLibVersion}</version>
69+
<groupId>com.company.project</groupId>
70+
<artifactId>springboot-microservice-common-lib</artifactId>
71+
<version>${pnCommonLibVersion}</version>
7272
</dependency>
7373
```
7474

build.gradle

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,19 @@ publishing {
3838
maven(MavenPublication) {
3939
from components.java
4040
pom {
41-
name = 'PN Common Library (java 21)'
41+
name = 'PN Common Library (Java 21)'
4242
description = 'Common Library for PN'
43-
url = 'https://gitlab.company.com/company-pn/springboot-microservice-common-lib'
43+
url = 'https://github.com/mmushfiq/springboot-microservice-common-lib'
4444
}
4545
}
4646
}
4747
repositories {
4848
maven {
49-
name "GitLab"
50-
url "https://gitlab.company.com/api/v4/projects/${gitlabProjectId}/packages/maven"
51-
credentials(HttpHeaderCredentials) {
52-
name = 'Deploy-Token'
53-
value = gitlabDeployToken
54-
}
55-
authentication {
56-
header(HttpHeaderAuthentication)
49+
name = "GitHub"
50+
url = uri("https://maven.pkg.github.com/mmushfiq/springboot-microservice-common-lib")
51+
credentials {
52+
username = System.getenv("GPR_USER") ?: project.findProperty("gpr.user") ?: ""
53+
password = System.getenv("GPR_TOKEN") ?: project.findProperty("gpr.token") ?: ""
5754
}
5855
}
5956
}

gradle.properties

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
projectVersion = 0.0.1
2-
3-
gitlabProjectId = 123
4-
gitlabDeployToken = xxxxxxxxxxxxxxxxxxxx
5-
62
springBootVersion = 3.3.3
73
springdocStarterVersion = 2.4.0
84
logstashLogbackVersion = 7.4

0 commit comments

Comments
 (0)