From 4b3ca6325e95a3149a2b70235bd1580a14a2a1c7 Mon Sep 17 00:00:00 2001 From: Piergiorgio Lucidi Date: Wed, 18 Sep 2024 11:09:39 +0200 Subject: [PATCH] updated local scripts for creating release artifacts and updated GitHub workflows (CONNECTORS-1754) --- .github/workflows/create-docker-image.yml | 4 ++- .../workflows/create-release-candidate.yml | 2 +- .github/workflows/license-check.yml | 2 +- .github/workflows/publish-maven-release.yml | 2 +- .github/workflows/publish-maven-snapshot.yml | 2 +- create-release-candidate-only-artifacts.sh | 28 +++++++++++++++++++ create-release-candidate.sh | 26 ++++++++--------- 7 files changed, 48 insertions(+), 18 deletions(-) create mode 100644 create-release-candidate-only-artifacts.sh diff --git a/.github/workflows/create-docker-image.yml b/.github/workflows/create-docker-image.yml index 0ada108431..b9f8850539 100644 --- a/.github/workflows/create-docker-image.yml +++ b/.github/workflows/create-docker-image.yml @@ -25,6 +25,7 @@ on: type: choice description: Select the ManifoldCF release options: + - 2.27-JDK-11 - 2.26-JDK-11 #Java 11 - 2.25-JDK-8 - 2.24-JDK-8 @@ -57,6 +58,7 @@ on: jobs: createDockerImageBuildingFromSourceCode: if: | + (github.event.inputs.release != '2.27-JDK-11') && (github.event.inputs.release != '2.26-JDK-11') && (github.event.inputs.release != '2.25-JDK-8') && (github.event.inputs.release != '2.24-JDK-8') && @@ -84,7 +86,7 @@ jobs: ref: release-${{ steps.mcf.outputs.release }} - name: Set up OpenJDK ${{ steps.jdk.outputs.version }} Temurin x64 - uses: actions/setup-java@v4.2.2 + uses: actions/setup-java@v4.3.0 with: java-version: '${{ steps.jdk.outputs.version }}' distribution: 'temurin' diff --git a/.github/workflows/create-release-candidate.yml b/.github/workflows/create-release-candidate.yml index 64b2597a59..8ea35b85c9 100644 --- a/.github/workflows/create-release-candidate.yml +++ b/.github/workflows/create-release-candidate.yml @@ -39,7 +39,7 @@ jobs: uses: actions/checkout@v4.1.7 - name: Set up OpenJDK 11 Temurin x64 - uses: actions/setup-java@v4.2.2 + uses: actions/setup-java@v4.3.0 with: java-version: '11' distribution: 'temurin' diff --git a/.github/workflows/license-check.yml b/.github/workflows/license-check.yml index a05bc3498b..a4cb41291d 100644 --- a/.github/workflows/license-check.yml +++ b/.github/workflows/license-check.yml @@ -29,7 +29,7 @@ jobs: uses: actions/checkout@v4.1.7 - name: Set up OpenJDK 11 Temurin x64 - uses: actions/setup-java@v4.2.2 + uses: actions/setup-java@v4.3.0 with: java-version: '11' distribution: 'temurin' diff --git a/.github/workflows/publish-maven-release.yml b/.github/workflows/publish-maven-release.yml index 3d5d848cbc..96d413dbcb 100644 --- a/.github/workflows/publish-maven-release.yml +++ b/.github/workflows/publish-maven-release.yml @@ -72,7 +72,7 @@ jobs: ref: ${{ github.event.inputs.release }} - name: Set up Java - uses: actions/setup-java@v4.2.2 + uses: actions/setup-java@v4.3.0 with: java-version: '11' distribution: 'temurin' diff --git a/.github/workflows/publish-maven-snapshot.yml b/.github/workflows/publish-maven-snapshot.yml index bc47fff78f..37ee68aa6a 100644 --- a/.github/workflows/publish-maven-snapshot.yml +++ b/.github/workflows/publish-maven-snapshot.yml @@ -36,7 +36,7 @@ jobs: uses: actions/checkout@v4.1.7 - name: Set up Java - uses: actions/setup-java@v4.2.2 + uses: actions/setup-java@v4.3.0 with: java-version: '11' distribution: 'temurin' diff --git a/create-release-candidate-only-artifacts.sh b/create-release-candidate-only-artifacts.sh new file mode 100644 index 0000000000..5ec72198f0 --- /dev/null +++ b/create-release-candidate-only-artifacts.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +#Get Maven POM version +export mcfVersion=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + +#Built Branch Version +export currentMavenVersion="$mcfVersion" +export suffixToRemove="SNAPSHOT" +export branchVersion=${currentMavenVersion%$suffixToRemove} + +#Update all the Maven modules with the new version +mvn versions:set -DnewVersion=$mcfVersion -DremoveSnapshot -DgenerateBackupPoms=false + +#Update Ant script with the new RC version +sed -i -e 's/"$mcfVersion"-dev/"$mcfVersion"/g' build.xml; + +#Update CHANGES.txt +sed -i -e 's/"$mcfVersion"-dev/Release "$mcfVersion"/g' CHANGES.txt; + +#Ant Build +ant make-core-deps make-deps image + +#Artifact version +export artifactVersion=$branchVersion"dev" + +#Rename KEYS and CHANGES.txt artifacts +cp KEYS apache-manifoldcf-$artifactVersion.KEYS +cp CHANGES.txt apache-manifoldcf-$artifactVersion.CHANGES.txt \ No newline at end of file diff --git a/create-release-candidate.sh b/create-release-candidate.sh index b99fa1b431..108682e758 100644 --- a/create-release-candidate.sh +++ b/create-release-candidate.sh @@ -5,24 +5,24 @@ releasecandidatetag=$1 export mcfVersion=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) #Built Branch Version -currentMavenVersion="$mcfVersion" -suffixToRemove="SNAPSHOT" -branchVersion=${currentMavenVersion%"$suffixToRemove"} +export currentMavenVersion="$mcfVersion" +export suffixToRemove="SNAPSHOT" +export branchVersion=${currentMavenVersion%$suffixToRemove} branchTag=$branchVersion$releasecandidatetag #Create new release candidate branch git branch release-$branchTag -git push --set-upstream origin release-branchTag -git checkout release-branchTag +git push --set-upstream origin release-$branchTag +git checkout release-$branchTag #Update all the Maven modules with the new version -mvn versions:set -DnewVersion=mcfVersion -DremoveSnapshot -DgenerateBackupPoms=false +mvn versions:set -DnewVersion=$mcfVersion -DremoveSnapshot -DgenerateBackupPoms=false #Update Ant script with the new RC version -sed -i 's/$mcfVersion-dev/$mcfVersion/g' build.xml; +sed -i -e 's/"$mcfVersion"-dev/"$mcfVersion"/g' build.xml; #Update CHANGES.txt -sed -i 's/$mcfVersion-dev/Release $mcfVersion/g' CHANGES.txt; +sed -i -e 's/"$mcfVersion"-dev/Release "$mcfVersion"/g' CHANGES.txt; #Ant Build ant make-core-deps make-deps image @@ -31,10 +31,10 @@ ant make-core-deps make-deps image mvn clean install -B -DskipTests -DskipITs #Update MCF version in the properties.xml files -sed -i 's/$mcfVersion-dev/$mcfVersion/g' dist/example/properties.xml; -sed -i 's/$mcfVersion-dev/$mcfVersion/g' dist/example-proprietary/properties.xml; -sed -i 's/$mcfVersion-dev/$mcfVersion/g' dist/multiprocess-file-example/properties.xml; -sed -i 's/$mcfVersion-dev/$mcfVersion/g' dist/multiprocess-file-example-proprietary/properties.xml; +sed -i -e 's/"$mcfVersion"-dev/"$mcfVersion"/g' dist/example/properties.xml; +sed -i -e 's/"$mcfVersion"-dev/"$mcfVersion"/g' dist/example-proprietary/properties.xml; +sed -i -e 's/"$mcfVersion"-dev/"$mcfVersion"/g' dist/multiprocess-file-example/properties.xml; +sed -i -e 's/"$mcfVersion"-dev/"$mcfVersion"/g' dist/multiprocess-file-example-proprietary/properties.xml; #RAT licence checks mvn -pl . apache-rat:check @@ -50,7 +50,7 @@ git commit -am "Create $releasecandidatetag tag for MCF $mcfVersion" git push #Artifact version -export artifactVersion=$branchVersiondev +export artifactVersion=$branchVersion"dev" #Rename KEYS and CHANGES.txt artifacts cp KEYS apache-manifoldcf-$artifactVersion.KEYS