From d6e749b3a39d30a48ad6e468f7d7d0cfc2d65761 Mon Sep 17 00:00:00 2001
From: Gunnar von der Beck <Gunnar.von-der-Beck@accso.de>
Date: Fri, 26 Jul 2024 14:39:20 +0200
Subject: [PATCH] chore: deleted outdated custom release action

---
 .../.pre-commit-config.yaml                   |  29 -----
 .../action-maven-release/.tool-versions       |   1 -
 .../actions/action-maven-release/action.yml   | 113 ------------------
 .../prepare-next-development-version.sh       |  32 -----
 .../resources/settings.xml                    |  45 -------
 5 files changed, 220 deletions(-)
 delete mode 100644 .github/actions/action-maven-release/.pre-commit-config.yaml
 delete mode 100644 .github/actions/action-maven-release/.tool-versions
 delete mode 100644 .github/actions/action-maven-release/action.yml
 delete mode 100755 .github/actions/action-maven-release/resources/prepare-next-development-version.sh
 delete mode 100644 .github/actions/action-maven-release/resources/settings.xml

diff --git a/.github/actions/action-maven-release/.pre-commit-config.yaml b/.github/actions/action-maven-release/.pre-commit-config.yaml
deleted file mode 100644
index cf023492..00000000
--- a/.github/actions/action-maven-release/.pre-commit-config.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-# See https://pre-commit.com for more information
-# See https://pre-commit.com/hooks.html for more hooks
-repos:
-  - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v3.4.0
-    hooks:
-      - id: trailing-whitespace
-      - id: end-of-file-fixer
-      - id: check-yaml
-      - id: check-added-large-files
-  - repo: https://github.com/pre-commit/mirrors-prettier
-    rev: v2.2.1
-    hooks:
-      - id: prettier
-  - repo: https://github.com/sirosen/check-jsonschema
-    rev: 0.3.0
-    hooks:
-      - id: check-github-workflows
-      - id: check-github-actions
-      - id: check-jsonschema
-        name: "Validate Example Workflows"
-        language: python
-        files: ^example-workflows/
-        types: [yaml]
-        args: ["--schemafile", "https://json.schemastore.org/github-workflow"]
-  - repo: https://github.com/gruntwork-io/pre-commit
-    rev: v0.1.12
-    hooks:
-      - id: shellcheck
diff --git a/.github/actions/action-maven-release/.tool-versions b/.github/actions/action-maven-release/.tool-versions
deleted file mode 100644
index c8286f20..00000000
--- a/.github/actions/action-maven-release/.tool-versions
+++ /dev/null
@@ -1 +0,0 @@
-pre-commit 3.7.1
diff --git a/.github/actions/action-maven-release/action.yml b/.github/actions/action-maven-release/action.yml
deleted file mode 100644
index ec5c585f..00000000
--- a/.github/actions/action-maven-release/action.yml
+++ /dev/null
@@ -1,113 +0,0 @@
-name: Release Camunda Community Project on Maven Central
-description: Encapsulates the release process of Camunda community extensions
-inputs:
-  artifacts-pattern:
-    description: Which artifacts to store. Set to empty string to disable.
-    required: false
-    default: ./target/nexus-staging/**/*.jar
-  run-tests:
-    default: ""
-    required: false
-    description: Wether to explicitly run maven tests prior to releasing
-  maven-additional-options:
-    description: Any extra Maven options
-    required: false
-    default: ""
-  maven-release-options:
-    description: Any extra Maven options for the release process (-DskipTests is already implied)
-    required: false
-    default: ""
-  release-version:
-    description: Release Version (usually tag name). If empty, a SNAPSHOT (with the currently configured version) will be deployed.
-    required: false
-  release-profile:
-    description: Maven profile to be selected for the release; typically "release".
-    required: false
-  nexus-usr:
-    description: Camunda Nexus username
-    required: true
-  nexus-psw:
-    description: Camunda Nexus password
-    required: true
-  maven-usr:
-    description: Maven Central username
-    required: true
-  maven-psw:
-    description: Maven Central password
-    required: true
-  maven-gpg-passphrase:
-    description: GPG passphrase used to unlock the signing key
-    required: true
-  maven-auto-release-after-close:
-    description: Flag indicating triggering of automatic release in OSS Maven Central if the repository closure was successful.
-    required: true
-    default: false
-  github-token:
-    description: GitHub token
-    required: true
-outputs:
-  artifacts_archive_path:
-    description: Filename of zipfile containing all files matched by artifacts-pattern.
-    value: ${{ steps.create-archive.outputs.filename }}
-runs:
-  using: composite
-  steps:
-    - name: Initialize
-      run: |-
-        echo Repo: ${GITHUB_REPOSITORY}
-        git config --global user.name "Release Bot"
-        git config --global user.email actions@github.com
-        test -n "${{inputs.release-profile}}" && echo 'RELEASE_PROFILE=-P${{inputs.release-profile}}' >> $GITHUB_ENV
-        cp -v ${{ github.action_path }}/resources/settings.xml $HOME/.m2/
-      shell: bash
-    - name: Run maven
-      run: |-
-        echo "===>>> Run Maven Build"
-        test -z "${{ inputs.run-tests }}" && SKIP_TESTS="-DskipTests"
-        mvn -B ${{ inputs.maven-additional-options }} clean package ${SKIP_TESTS}
-      shell: bash
-    - name: Publish SNAPSHOT
-      run: |-
-        echo "===>>> Publish SNAPSHOT"
-        test -n "${{ inputs.release-version }}" && echo "::debug::Not publishing SNAPSHOT because release-version is set" && exit 0
-        mvn -B ${{ inputs.maven-additional-options }} -DskipTests ${{ inputs.maven-release-options }} clean deploy
-        find . -path '**target/nexus-staging/deferred/.index' -exec sed -i 's@:camunda-nexus:.*$@:central:https://oss.sonatype.org/content/repositories/snapshots/@g' {} +
-        mvn -B ${{ inputs.maven-additional-options }} -DskipTests ${{ inputs.maven-release-options }} org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged
-      shell: bash
-      env:
-        NEXUS_USR: ${{ inputs.nexus-usr}}
-        NEXUS_PSW: ${{ inputs.nexus-psw }}
-        MAVEN_USR: ${{ inputs.maven-usr }}
-        MAVEN_PSW: ${{ inputs.maven-psw }}
-    - name: Publish Maven Release
-      run: |-
-        echo "===>>> Publish Maven Release"
-        test -z "${{ inputs.release-version }}" && echo "::debug::Skipping Release because release-version is unset" && exit 0
-        # 1. set version
-        mvn -B ${{ inputs.maven-additional-options }} versions:set org.codehaus.mojo:versions-maven-plugin:2.8.1:update-child-modules -DnewVersion=${{ inputs.release-version }}
-        # 2. perform release
-        mvn -B ${{ inputs.maven-additional-options }} ${RELEASE_PROFILE} ${{ inputs.maven-release-options }} -DskipTests -DnexusUrl=https://oss.sonatype.org/ -DserverId=central -Drelease-version=${{ inputs.release-version }} -Dgpg.sign initialize \
-        -DautoReleaseAfterClose=${{ inputs.maven-auto-release-after-close }} \
-          clean source:jar javadoc:jar \
-          deploy org.apache.maven.plugins:maven-gpg-plugin:sign \
-          nexus-staging:deploy
-        echo "===>>> Successfully deployed release to nexus staging"
-      shell: bash
-      env:
-        NEXUS_USR: ${{ inputs.nexus-usr}}
-        NEXUS_PSW: ${{ inputs.nexus-psw }}
-        MAVEN_USR: ${{ inputs.maven-usr }}
-        MAVEN_PSW: ${{ inputs.maven-psw }}
-        MAVEN_GPG_PASSPHRASE: ${{ inputs.maven-gpg-passphrase }}
-    - name: Prepare next development version
-      run: ${{ github.action_path }}/resources/prepare-next-development-version.sh "${{ github.event.repository.default_branch }}" "${{ inputs.release-version }}" "${{ inputs.maven-additional-options }}"
-      shell: bash
-    - name: Archive artifacts
-      run: |-
-        test -z "${{ inputs.artifacts-pattern }}" && echo "::debug::Skipping archiving because artifacts-pattern is unset" && exit 0
-        # Filename: [repo without org]-[version].zip
-        ZIPFILE=${GITHUB_REPOSITORY#*/}-${{ inputs.release-version }}.zip
-        zip $ZIPFILE $(find . -path ${{ inputs.artifacts-pattern }})
-        echo "::set-output name=filename::${ZIPFILE}"
-      shell: bash
-      id: create-archive
\ No newline at end of file
diff --git a/.github/actions/action-maven-release/resources/prepare-next-development-version.sh b/.github/actions/action-maven-release/resources/prepare-next-development-version.sh
deleted file mode 100755
index 8ece2233..00000000
--- a/.github/actions/action-maven-release/resources/prepare-next-development-version.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-
-
-RELEASE_VERSION=$2
-DEFAULT_BRANCH=$1
-MAVEN_ADDITIONAL_OPTIONS=$3
-
-[ $# != 3 ] && echo "::error::prepare-next-development-version needs exactly 3 arguments." && exit 1
-test -z "${RELEASE_VERSION}" && echo "::debug::Skipping Release because release-version is unset" && exit 0
-test -z "${DEFAULT_BRANCH}" && echo "::error::Default branch needs to be passed" && exit 1
-
-git fetch --no-tags
-git checkout "${DEFAULT_BRANCH}"
-
-[ "$(git rev-list -n1 "${RELEASE_VERSION}")" != "$(git rev-list -n1 "${DEFAULT_BRANCH}")" ] && echo "${RELEASE_VERSION} not pointing to tip of ${DEFAULT_BRANCH}" && exit 0
-
-# Commit the release version change in the pom.xml
-git add ./**pom.xml
-git commit -am "release(v${RELEASE_VERSION})"
-
-# Overwrite existing release tag that was created to trigger this function with release version in pom.xml
-git tag -fa "${RELEASE_VERSION}" -m "release(v${RELEASE_VERSION})"
-git push origin --tags -f
-
-# shellcheck disable=SC2086 # don't use quotes because we do want argument splitting
-mvn -B ${MAVEN_ADDITIONAL_OPTIONS} org.apache.maven.plugins:maven-release-plugin:update-versions -DgenerateBackupPoms=false
-
-# Commit next version calculated by maven
-# https://maven.apache.org/guides/getting-started/index.html#what-is-a-snapshot-version
-git add ./**pom.xml
-git commit -am "release(v${RELEASE_VERSION}): prepare for next development iteration"
-git push
diff --git a/.github/actions/action-maven-release/resources/settings.xml b/.github/actions/action-maven-release/resources/settings.xml
deleted file mode 100644
index 623eea99..00000000
--- a/.github/actions/action-maven-release/resources/settings.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
-                        http://maven.apache.org/xsd/settings-1.0.0.xsd">
-
-  <activeProfiles>
-    <activeProfile>github</activeProfile>
-  </activeProfiles>
-
-  <profiles>
-    <profile>
-      <id>github</id>
-      <repositories>
-        <repository>
-          <id>central</id>
-          <url>https://repo1.maven.org/maven2</url>
-          <releases>
-            <enabled>true</enabled>
-          </releases>
-          <snapshots>
-            <enabled>false</enabled>
-          </snapshots>
-        </repository>
-      </repositories>
-      <pluginRepositories/>
-    </profile>
-  </profiles>
-
-  <servers>
-      <server>
-          <id>camunda-nexus</id>
-          <username>${env.NEXUS_USR}</username>
-          <password>${env.NEXUS_PSW}</password>
-        </server>
-        <server>
-            <id>central</id>
-            <username>${env.MAVEN_USR}</username>
-            <password>${env.MAVEN_PSW}</password>
-        </server>
-        <server>
-            <id>gpg.passphrase</id>
-            <passphrase>${env.MAVEN_GPG_PASSPHRASE}</passphrase>
-        </server>
-    </servers>
-  <mirrors/>
-  <pluginGroups/>
-</settings>