diff --git a/.github/workflows/release-maven-image.yaml b/.github/workflows/release-maven-image.yaml new file mode 100644 index 00000000..238b3b41 --- /dev/null +++ b/.github/workflows/release-maven-image.yaml @@ -0,0 +1,73 @@ +name: release-maven-image + +on: + workflow_dispatch: + inputs: + releaseVersion: + description: "Version to use when preparing a release (e.g., 1.2.3)" + required: true + default: "0.0.1" + developmentVersion: + description: "Version to use for new local working copy (e.g., 1.2.4-SNAPSHOT)" + required: true + default: "0.0.2-SNAPSHOT" + app-path: + type: choice + description: Service-Name + required: true + options: + - refarch-backend + - refarch-eai + +jobs: + release-maven: + runs-on: ubuntu-latest + outputs: + MVN_ARTIFACT_ID: ${{ steps.maven-release-step.outputs.MVN_ARTIFACT_ID }} + ARTIFACT_NAME: ${{ steps.maven-release-step.outputs.artifact-name }} + env: + TZ: Europe/Berlin # timezone + steps: + - id: maven-release-step + uses: it-at-m/.github/.github/actions/action-maven-release@main + with: + app-path: "/${{ github.event.inputs.app-path }}" + releaseVersion: "${{ github.event.inputs.releaseVersion }}" + developmentVersion: "${{ github.event.inputs.developmentVersion }}" + SIGN_KEY_PASS: ${{ secrets.gpg_passphrase }} + CENTRAL_USERNAME: ${{ secrets.sonatype_username }} + CENTRAL_PASSWORD: ${{ secrets.sonatype_password }} + GDP_PRIVATE_KEY: ${{ secrets.gpg_private_key }} + + build-image: + runs-on: ubuntu-latest + needs: release-maven + steps: + - uses: it-at-m/.github/.github/actions/action-build-image@main + with: + path: "${{ github.event.inputs.app-path }}" + image-name: "${{ github.event.inputs.app-path }}" + registry-password: ${{ secrets.GITHUB_TOKEN }} + artifact-name: ${{ needs.release-maven.outputs.ARTIFACT_NAME }} + registry-username: ${{ github.actor }} + image-tags: | + type=semver,pattern={{version}},value=${{ github.event.inputs.releaseVersion }} + + create-github-release: + needs: release-maven + runs-on: ubuntu-latest + steps: + - name: Download a single artifact + uses: actions/download-artifact@v4 + with: + name: ${{ needs.release-maven.outputs.ARTIFACT_NAME }} + - name: Create GitHub Release + id: create_release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{needs.release-maven.outputs.MVN_ARTIFACT_ID}}-${{ github.event.inputs.releaseVersion }} + draft: false + prerelease: false + generate_release_notes: false + files: | + ${{ github.event.inputs.app-path }}/target/*.jar