diff options
| author | Paul-Christian Volkmer | 2025-11-28 12:27:19 +0100 |
|---|---|---|
| committer | GitHub | 2025-11-28 12:27:19 +0100 |
| commit | afecf5534ab031f294274116a6297fbed10017b9 (patch) | |
| tree | be3357c0ab299fe1a6454b148e7cf569a3ab33ea | |
| parent | df670aef05b36fed0c1ffe601894205d6001f486 (diff) | |
build: update ci (#201)
| -rw-r--r-- | .github/workflows/ci.yml (renamed from .github/workflows/test.yml) | 41 | ||||
| -rw-r--r-- | .github/workflows/deploy.yml | 35 | ||||
| -rw-r--r-- | .github/workflows/release.yml | 27 | ||||
| -rw-r--r-- | .release-please-manifest.json | 3 | ||||
| -rw-r--r-- | build.gradle.kts | 2 | ||||
| -rw-r--r-- | release-please-config.json | 18 |
6 files changed, 72 insertions, 54 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/ci.yml index 37ad568..170f5dc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,15 @@ -name: 'Run Tests' +name: CI on: push: branches: [ 'master' ] - tags: [ '*' ] pull_request: - branches: [ '*' ] + branches: [ 'master' ] + release: + types: [ 'created' ] + +permissions: + contents: read jobs: tests: @@ -16,13 +20,10 @@ jobs: with: java-version: '21' distribution: 'temurin' - - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 - - name: Execute tests run: ./gradlew test - integrationTests: runs-on: ubuntu-latest steps: @@ -31,42 +32,46 @@ jobs: with: java-version: '21' distribution: 'temurin' - - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 - - name: Execute integration tests run: ./gradlew integrationTest - - # Deploy preview build for testing based on latest successful tested master - deployPreview: + build: runs-on: ubuntu-latest + permissions: + contents: read + packages: write needs: - tests - integrationTests - if: github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: java-version: '21' distribution: 'temurin' - - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 - + # Setup and build docker image - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - + - name: Build image + run: ./gradlew bootBuildImage + # Deploy docker image - name: Login to Docker Hub uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - - name: Execute image build and push + - name: Deploy release image + if: ${{ github.event_name == 'release' && github.event.action == 'created' }} + run: | + docker tag ghcr.io/${{ github.repository }} ghcr.io/${{ github.repository }}:${{ github.ref_name }} + docker push ghcr.io/${{ github.repository }} + docker push ghcr.io/${{ github.repository }}:${{ github.ref_name }} + - name: Deploy preview image + if: ${{ github.ref == 'refs/heads/master' }} run: | - ./gradlew bootBuildImage docker tag ghcr.io/${{ github.repository }} ghcr.io/${{ github.repository }}:preview docker push ghcr.io/${{ github.repository }}:preview
\ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 65b5e78..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: 'Run build and deploy' - -on: - release: - types: [ 'published' ] - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'temurin' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Execute image build and push - run: | - ./gradlew bootBuildImage - docker tag ghcr.io/${{ github.repository }} ghcr.io/${{ github.repository }}:${{ github.ref_name }} - docker push ghcr.io/${{ github.repository }} - docker push ghcr.io/${{ github.repository }}:${{ github.ref_name }}
\ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c89694b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: release-please + +on: + push: + branches: [ 'master' ] + +permissions: + contents: read + +jobs: + release-please: + name: run release-please + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/create-github-app-token@v2 + id: app-token + with: + app-id: ${{ secrets.RELEASE_APP_ID }} + private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + + - uses: googleapis/release-please-action@v4 + with: + token: ${{ steps.app-token.outputs.token }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..9d5158b --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.12.1" +}
\ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 7e5acaa..befc0db 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,7 +18,7 @@ plugins { } group = "dev.dnpm" -version = "0.13.0-SNAPSHOT" +version = "0.13.0-SNAPSHOT" // x-release-please-version var versions = mapOf( "mtb-dto" to "0.1.1", diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..a6b3131 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/refs/heads/main/schemas/config.json", + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "include-v-in-tag": true, + "include-component-in-tag": false, + "release-type": "simple", + "packages": { + ".": { + "extra-files": [ + { + "type": "generic", + "path": "build.gradle.kts" + } + ] + } + } +}
\ No newline at end of file |
