From 322e1c3316ef1f27098df60ae466467454583ae8 Mon Sep 17 00:00:00 2001 From: Sergey Grigoriev Date: Mon, 15 Jul 2024 12:52:28 +0200 Subject: [PATCH 1/2] feat: migration to generic v6.2.0 --- .github/workflows/maven-release.yml | 4 +-- .scripts/convert-readme.sh | 46 ----------------------------- README.md | 8 ++--- pom.xml | 14 +++++++-- 4 files changed, 18 insertions(+), 54 deletions(-) delete mode 100755 .scripts/convert-readme.sh diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml index 8e6ab4f..3aa1282 100644 --- a/.github/workflows/maven-release.yml +++ b/.github/workflows/maven-release.yml @@ -9,6 +9,8 @@ jobs: permissions: contents: read packages: write + env: + GITHUB_TOKEN: ${{ github.token }} steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - name: Set up JDK and Maven @@ -79,5 +81,3 @@ jobs: - name: Publish to GitHub Packages if: ${{ !endsWith(steps.artefact_version.outputs.version, '-SNAPSHOT') && github.ref == 'refs/heads/main' }} run: mvn --batch-mode deploy -P gpg-sign -P deploy-github-packages - env: - GITHUB_TOKEN: ${{ github.token }} diff --git a/.scripts/convert-readme.sh b/.scripts/convert-readme.sh deleted file mode 100755 index 413bcb1..0000000 --- a/.scripts/convert-readme.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -set -e - -# Check if a command is installed -function check_command() { - if ! command -v "$1" &> /dev/null; then - echo -e "\033[0;31m $1 is not installed! \033[0m" >&2 - echo -e "\033[0;31m Help for About page will not be generated! \033[0m" >&2 - - if [ -n "$FAIL_ON_CHECK_COMMANDS" ]; then - exit 1 - else - exit 0 - fi - fi -} - -# Check if required commands are installed -check_command jq -check_command curl -check_command awk - -INPUT_FILE="${1:-README.md}" -OUTPUT_FILE="${2:-README.html}" - -# Convert the markdown file to a JSON payload -JSON_PAYLOAD=$(jq -R -s '{"mode": "gfm", "text": .}' < "$INPUT_FILE") - -# Send the JSON payload to the GitHub API -CURL_OUTPUT=$(curl -L \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/markdown \ - -d "$JSON_PAYLOAD") - -# Process the curl output with awk to remove the Build, Installation and Changelog sections -MODIFIED_CONTENT=$(echo "$CURL_OUTPUT" | awk ' -/

Build<\/h2>/ {skip=1; next} -/

Polarion configuration<\/h2>/ {skip=0} -/

Changelog<\/h2>/ {skip=1; next} -!skip') - -# Write the modified content to the output file -echo "$MODIFIED_CONTENT" > "$OUTPUT_FILE" diff --git a/README.md b/README.md index da37d6b..313c6de 100644 --- a/README.md +++ b/README.md @@ -11,18 +11,18 @@ This API can be called using REST API and in Velocity Context. ## Build -JSON editor extension can be produced using maven: +This extension can be produced using maven: ```bash mvn clean package ``` ## Installation to Polarion -To install JSON editor extension to Polarion `ch.sbb.polarion.extension.json.editor-.jar` should be copied to `/polarion/extensions/json-editor/eclipse/plugins` - +To install JSON editor extension to Polarion `ch.sbb.polarion.extension.json.editor-.jar` +should be copied to `/polarion/extensions/json-editor/eclipse/plugins` It can be done manually or automated using maven build: ```bash -mvn clean install -Pinstall-to-local-polarion +mvn clean install -P install-to-local-polarion ``` For automated installation with maven env variable `POLARION_HOME` should be defined and point to folder where Polarion is installed. diff --git a/pom.xml b/pom.xml index efaade4..e204bb5 100644 --- a/pom.xml +++ b/pom.xml @@ -28,14 +28,14 @@ SBB Polarion Team polarion-opensource@sbb.ch SBB AG - http://www.sbb.ch + https://www.sbb.ch scm:git:git://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.api-extender.git scm:git:ssh://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.api-extender.git - http://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.api-extender/tree/main + https://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.api-extender/tree/main @@ -60,6 +60,16 @@ + + org.apache.maven.plugins + maven-clean-plugin + + + + ch.sbb.maven.plugins + markdown2html-maven-plugin + + org.apache.maven.plugins maven-dependency-plugin From da238d56a62fc54afaaad3fb8f544ab3b8783081 Mon Sep 17 00:00:00 2001 From: Sergey Grigoriev Date: Mon, 15 Jul 2024 12:55:39 +0200 Subject: [PATCH 2/2] feat: migration to generic v6.2.0 --- .github/workflows/maven-release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml index 3aa1282..ccaffa2 100644 --- a/.github/workflows/maven-release.yml +++ b/.github/workflows/maven-release.yml @@ -70,8 +70,6 @@ jobs: run: cat /home/runner/.m2/settings.xml - name: Build with Maven run: mvn --batch-mode clean package - env: - FAIL_ON_CHECK_COMMANDS: 'true' - name: Extract artefact version id: artefact_version run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT