diff --git a/.github/workflows/build_gateway.yaml b/.github/workflows/build_gateway.yaml index 8c19feea..ee10ae53 100644 --- a/.github/workflows/build_gateway.yaml +++ b/.github/workflows/build_gateway.yaml @@ -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 diff --git a/.github/workflows/build_integrations.yaml b/.github/workflows/build_integrations.yaml index 61cb967b..cdcb16ab 100644 --- a/.github/workflows/build_integrations.yaml +++ b/.github/workflows/build_integrations.yaml @@ -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 diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml deleted file mode 100644 index e2d2f30e..00000000 --- a/.github/workflows/maven.yaml +++ /dev/null @@ -1,72 +0,0 @@ -env: - JAVA_VERSION: 21 - REGISTRY: ghcr.io - TZ: Europe/Berlin - -on: - workflow_call: - inputs: - module: - description: 'Module to build' - type: string - required: true - snapshot-release: - description: 'Snapshot release?' - type: boolean - default: true - build-images: - description: 'Build and push images?' - type: boolean - default: false - release-version: - description: 'Release version' - type: string - required: false - default: "X.Y.Z" - next-version: - description: "Next version to use after release" - type: string - required: false - default: "X.Y.Z-SNAPSHOT" - -jobs: - build-maven: - runs-on: ubuntu-latest - steps: - - uses: ./.github/actions/build-maven - with: - module: ${{ inputs.module }} - release: ${{ inputs.snapshot-release == false }} - release-version: ${{ inputs.release-version }} - next-version: ${{ inputs.next-version }} - java-version: "21" - gpg-private-key: ${{ secrets.gpg_private_key }} - gpg-passphrase: ${{ secrets.gpg_passphrase }} - sonatype-username: ${{ secrets.sonatype_username }} - sonatype-password: ${{ secrets.sonatype_password }} - - build-images: - if: inputs.build-images == true - needs: build-maven - runs-on: ubuntu-latest - strategy: - matrix: - include: - - name: refarch-gateway - path: ./refarch-gateway - module: refarch-gateway - - name: s3-integration-rest-service - path: ./refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service - module: refarch-integrations - steps: - - uses: ./.github/actions/build-image - if: matrix.module == inputs.module - with: - registry: ${{ env.REGISTRY }} - 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.snapshot-release == false }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1ac25089..fb67aae8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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