Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add maven release #513

Merged
merged 11 commits into from
Dec 2, 2024
73 changes: 73 additions & 0 deletions .github/workflows/release-maven-image.yaml
hupling marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: release-maven-image

on:
workflow_dispatch:
inputs:
releaseVersion:
description: "Default version to use when preparing a release."
required: true
default: "X.Y.Z"
developmentVersion:
description: "Default version to use for new local working copy."
required: true
default: "X.Y.Z-SNAPSHOT"
hupling marked this conversation as resolved.
Show resolved Hide resolved
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
DanielOber marked this conversation as resolved.
Show resolved Hide resolved
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
hupling marked this conversation as resolved.
Show resolved Hide resolved
with:
path: "${{ github.event.inputs.app-path }}"
image-name: "${{ github.event.inputs.app-path }}"
hupling marked this conversation as resolved.
Show resolved Hide resolved
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
hupling marked this conversation as resolved.
Show resolved Hide resolved
with:
hupling marked this conversation as resolved.
Show resolved Hide resolved
tag_name: ${{needs.release-maven.outputs.MVN_ARTIFACT_ID}}-${{ github.event.inputs.releaseVersion }}
draft: false
prerelease: false
generate_release_notes: false
hupling marked this conversation as resolved.
Show resolved Hide resolved
files: |
${{ github.event.inputs.app-path }}/target/*.jar
hupling marked this conversation as resolved.
Show resolved Hide resolved