Skip to content

add Github workflow and replace Gitlab publishing to Github #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI Pipeline

on:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
build:
name: Build with Gradle
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'

- name: Grant execute permission for Gradle
run: chmod +x gradlew

- name: Build the project
run: ./gradlew build

publish:
name: Publish to GitHub Packages
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'

- name: Grant execute permission for Gradle
run: chmod +x gradlew

- name: Publish to GitHub Packages
run: ./gradlew publish
env:
GPR_USER: ${{ secrets.GPR_USER }}
GPR_TOKEN: ${{ secrets.GPR_TOKEN }}
37 changes: 0 additions & 37 deletions .gitlab-ci.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
![Checkstyle](https://img.shields.io/badge/Checkstyle-10.14.2-cyan)
![GitHub](https://img.shields.io/github/license/isopropylcyanide/Jwt-Spring-Security-JPA?color=blue)

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.
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.

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

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

```xml
<dependency>
<groupId>com.company.project</groupId>
<artifactId>springboot-microservice-common-lib</artifactId>
<version>${pnCommonLibVersion}</version>
<groupId>com.company.project</groupId>
<artifactId>springboot-microservice-common-lib</artifactId>
<version>${pnCommonLibVersion}</version>
</dependency>
```

Expand Down
17 changes: 7 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,19 @@ publishing {
maven(MavenPublication) {
from components.java
pom {
name = 'PN Common Library (java 21)'
name = 'PN Common Library (Java 21)'
description = 'Common Library for PN'
url = 'https://gitlab.company.com/company-pn/springboot-microservice-common-lib'
url = 'https://github.com/mmushfiq/springboot-microservice-common-lib'
}
}
}
repositories {
maven {
name "GitLab"
url "https://gitlab.company.com/api/v4/projects/${gitlabProjectId}/packages/maven"
credentials(HttpHeaderCredentials) {
name = 'Deploy-Token'
value = gitlabDeployToken
}
authentication {
header(HttpHeaderAuthentication)
name = "GitHub"
url = uri("https://maven.pkg.github.com/mmushfiq/springboot-microservice-common-lib")
credentials {
username = System.getenv("GPR_USER") ?: project.findProperty("gpr.user") ?: ""
password = System.getenv("GPR_TOKEN") ?: project.findProperty("gpr.token") ?: ""
}
}
}
Expand Down
4 changes: 0 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
projectVersion = 0.0.1

gitlabProjectId = 123
gitlabDeployToken = xxxxxxxxxxxxxxxxxxxx

springBootVersion = 3.3.3
springdocStarterVersion = 2.4.0
logstashLogbackVersion = 7.4
Expand Down