Skip to content

Commit

Permalink
♻️ ci extract maven build to action use
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhir committed Sep 2, 2024
1 parent fcc8f7a commit 66eddcf
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 100 deletions.
27 changes: 20 additions & 7 deletions .github/workflows/build_gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,23 @@ on:
- main

jobs:
maven:
uses: ./.github/workflows/maven.yaml
with:
module: refarch-gateway
build-images: ${{ github.ref_name == 'main' }}
release-version: dev
secrets: inherit
build-maven:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/build-maven
with:
module: refarch-gateway

build-images:
if: github.ref_name == 'main'
needs: build-maven
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/build-image
with:
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
path: ./refarch-gateway
image-name: refarch-gateway
image-tags: |
type=raw,value=dev
32 changes: 25 additions & 7 deletions .github/workflows/build_integrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,28 @@ on:
- main

jobs:
maven:
uses: ./.github/workflows/maven.yaml
with:
module: refarch-integrations
build-images: ${{ github.ref_name == 'main' }}
release-version: dev
secrets: inherit
build-maven:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/build-maven
with:
module: refarch-integrations

build-images:
if: github.ref_name == 'main'
needs: build-maven
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: s3-integration-rest-service
path: ./refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service
steps:
- uses: ./.github/actions/build-image
with:
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
path: ${{ matrix.path }}
image-name: ${{ matrix.name }}
image-tags: |
type=raw,value=dev
72 changes: 0 additions & 72 deletions .github/workflows/maven.yaml

This file was deleted.

68 changes: 54 additions & 14 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,74 @@ on:
options:
- refarch-gateway
- refarch-integrations
snapshot-release:
description: 'Snapshot release?'
release:
description: 'Release?'
type: boolean
default: false
default: true
release-version:
description: 'Release version'
type: string
required: true
default: "X.Y.Z"
next-version:
description: "Next version to use after release."
description: "Next version to use after release"
type: string
required: true
default: "X.Y.Z-SNAPSHOT"

jobs:
build:
uses: ./.github/workflows/maven.yaml
with:
module: ${{ inputs.module }}
snapshot-release: ${{ inputs.snapshot-release != false }}
build-images: true
release-version: ${{ inputs.release-version }}
secrets: inherit
build-maven:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/build-maven
with:
module: ${{ inputs.module }}
release: ${{ inputs.release }}
release-version: ${{ inputs.release-version }}
next-version: ${{ inputs.next-version }}
gpg-private-key: ${{ secrets.gpg_private_key }}
gpg-passphrase: ${{ secrets.gpg_passphrase }}
sonatype-username: ${{ secrets.sonatype_username }}
sonatype-password: ${{ secrets.sonatype_password }}

build-images-gateway:
if: inputs.module == 'refarch-gateway'
needs: build-maven
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/build-image
with:
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
path: ./refarch-gateway
image-name: refarch-gateway
image-tags: |
type=raw,value=${{ inputs.release-version }}
type=raw,value=latest,enable=${{ inputs.release == true }}
build-images-integrations:
if: inputs.module == 'refarch-integrations'
needs: build-maven
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: s3-integration-rest-service
path: ./refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service
steps:
- uses: ./.github/actions/build-image
with:
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
path: ${{ matrix.path }}
image-name: ${{ matrix.name }}
image-tags: |
type=raw,value=${{ inputs.release-version }}
type=raw,value=latest,enable=${{ inputs.release == true }}
create-github-release:
if: ${{ inputs.snapshot-release == false }}
needs: build
if: ${{ inputs.release == true }}
needs: build-maven
runs-on: ubuntu-latest
steps:
- name: Create GitHub Release
Expand Down

0 comments on commit 66eddcf

Please sign in to comment.