Skip to content

Commit

Permalink
chore: Integrate release process
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisingenhaag committed Mar 23, 2024
1 parent acc338e commit 8204649
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 9 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/gradle-build-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build

on:
push:
branches-ignore:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set up JDK 21 for x64
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
architecture: x64
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build with Gradle
run: ./gradlew build
17 changes: 15 additions & 2 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
name: Build

on:
- push
push:
branches:
- main

permissions:
packages: write
contents: write

jobs:
build:
Expand All @@ -17,5 +23,12 @@ jobs:
architecture: x64
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Build with Gradle
run: ./gradlew build
env:
GH_TOKEN: '${{secrets.GITHUB_TOKEN}}'
GH_BRANCH: '${{github.ref.name}}'
run: ./gradlew release -Prelease.useAutomaticVersion=true --stacktrace
12 changes: 5 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ tasks.named('test') {
}

bootBuildImage {
imageName = "registry.gitlab.com/cin/${project.name}:${project.version}"
tags = ["registry.gitlab.com/cin/${project.name}:${System.getenv("CI_COMMIT_BRANCH")}"]
imageName = "ghcr.io/chrisingenhaag/${project.name}:${project.version}"
tags = ["ghcr.io/chrisingenhaag/${project.name}:${System.getenv("GH_BRANCH")}"]
publish = !project.version.contains("-SNAPSHOT")
docker {
publishRegistry {
url = System.getenv("CI_REGISTRY") ?: "n/a"
username = System.getenv("CI_REGISTRY_USER") ?: "n/a"
password = System.getenv("CI_REGISTRY_PASSWORD") ?: "n/a"
url = "https://ghcr.io"
token = System.getenv("GH_TOKEN") ?: "n/a"
}
}
}
Expand All @@ -56,11 +55,10 @@ release {
git {
requireBranch.set('main')
pushOptions.add("-o ci.skip")
preCommitText = "[ci skip]"
}
}



test {
finalizedBy jacocoTestReport, jacocoTestCoverageVerification
}
Expand Down

0 comments on commit 8204649

Please sign in to comment.