Skip to content

Commit

Permalink
[patch] CARD-72: add workflow to sec svc
Browse files Browse the repository at this point in the history
  • Loading branch information
jrsmth-tier2 committed May 31, 2024
1 parent 92f1f0b commit ced4492
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/develop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: develop
on:
push:
branches: [ develop ]
jobs:
test:
name: test
permissions:
packages: read
secrets: inherit
uses: ./.github/workflows/step-test.yaml
25 changes: 25 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: main
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
test:
name: test
permissions:
packages: read
secrets: inherit
uses: ./.github/workflows/step-test.yaml
release:
needs: test
name: release
permissions:
packages: write
contents: write
uses: ./.github/workflows/step-release.yaml
merge:
needs: release
name: merge
permissions:
contents: write
uses: ./.github/workflows/step-merge.yaml
17 changes: 17 additions & 0 deletions .github/workflows/step-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: merge
on:
workflow_call:
jobs:
merge:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Merge into Develop ➡️
uses: devmasx/merge-branch@master
with:
type: now
from_branch: main
target_branch: develop
message: Merge version bump into develop
github_token: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/step-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: release
on:
workflow_call:
jobs:
release:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Set-up Java ☕
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 21
- name: Set-up Gradle 🔨
uses: gradle/actions/setup-gradle@v3
- name: Set-up Git 🐵
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Release 🏷️
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew release
22 changes: 22 additions & 0 deletions .github/workflows/step-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: test
on:
workflow_call:
jobs:
test:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Set-up Java ☕
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 21
- name: Set-up Gradle 🔨
uses: gradle/actions/setup-gradle@v3
- name: Test 📐
env:
GPR_USER: ${{ secrets.GPR_USER }}
GPR_KEY: ${{ secrets.GPR_KEY }}
run: ./gradlew test -i
35 changes: 34 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ plugins {
kotlin("jvm") version "1.9.23"
kotlin("plugin.spring") version "1.9.23"
id("groovy")
id("net.researchgate.release") version "3.0.2"
id("maven-publish")
}

group = "io.jrsmth.cardinal"
Expand All @@ -29,7 +31,6 @@ repositories {
}

dependencies {
// implementation("io.jrsmth.cardinal:common:0.0.3-SNAPSHOT")
implementation("io.jrsmth.cardinal:common:0.0.2")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-validation")
Expand Down Expand Up @@ -62,3 +63,35 @@ tasks.withType<KotlinCompile> {
tasks.withType<Test> {
useJUnitPlatform()
}

tasks.bootJar {
enabled = false
}

tasks.jar {
enabled = true
}

release {
buildTasks.add("publish")
}

publishing {
publications {
create<MavenPublication>("default") {
from(components["java"])
}
}

repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/cardinal-app/security-services")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

0 comments on commit ced4492

Please sign in to comment.