Skip to content

Commit

Permalink
build: Merged changes back from the release branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdutz committed Feb 16, 2024
1 parent 6a387e6 commit 04ece29
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 102 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Incompatible changes
Bug Fixes
---------

==============================================================
Apache PLC4X 0.12.0
==============================================================

Expand Down
2 changes: 2 additions & 0 deletions code-generation/language-c/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
<configuration>
<skipInvocation>${skip-code-generation-tests}</skipInvocation>
<debug>true</debug>
<!-- Use the "test" scope for filling the tests local repository -->
<scope>test</scope>
<streamLogsOnFailures>true</streamLogsOnFailures>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<projectsDirectory>src/test/resources</projectsDirectory>
Expand Down
2 changes: 2 additions & 0 deletions code-generation/language-go/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
<configuration>
<skipInvocation>${skip-code-generation-tests}</skipInvocation>
<debug>true</debug>
<!-- Use the "test" scope for filling the tests local repository -->
<scope>test</scope>
<streamLogsOnFailures>true</streamLogsOnFailures>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<projectsDirectory>src/test/resources</projectsDirectory>
Expand Down
4 changes: 4 additions & 0 deletions code-generation/language-python/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
<description>Code generation template for generating Python code</description>

<properties>
<!-- Disabled for now as the python code doesn't seem to build -->
<skip-code-generation-tests>true</skip-code-generation-tests>
<project.build.outputTimestamp>2024-02-16T14:53:02Z</project.build.outputTimestamp>
</properties>

Expand All @@ -55,6 +57,8 @@
<configuration>
<skipInvocation>${skip-code-generation-tests}</skipInvocation>
<debug>true</debug>
<!-- Use the "test" scope for filling the tests local repository -->
<scope>test</scope>
<streamLogsOnFailures>true</streamLogsOnFailures>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<projectsDirectory>src/test/resources</projectsDirectory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
<relativePath>../../../..</relativePath>
</parent>

<artifactId>plc4j-java-mspec-test</artifactId>
<artifactId>plc4py-python-mspec-test</artifactId>

<name>PLC4J: Driver: Java Mspec Test</name>
<name>PLC4PY: Driver: Python Mspec Test</name>
<description></description>

<build>
<plugins>
<plugin>
<!--plugin>
<groupId>org.apache.plc4x.plugins</groupId>
<artifactId>plc4x-maven-plugin</artifactId>
<version>${plc4x-code-generation.version}</version>
Expand All @@ -48,65 +48,18 @@
</goals>
<configuration>
<protocolName>test</protocolName>
<languageName>java</languageName>
<languageName>python</languageName>
<outputFlavor>read-write</outputFlavor>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-feature-xml</id>
<phase>compile</phase>
<goals>
<!-- Generate the feature.xml -->
<goal>features-generate-descriptor</goal>
<!-- Check the feature.xml -->
<goal>verify</goal>
</goals>
<configuration>
<enableGeneration>true</enableGeneration>
<aggregateFeatures>true</aggregateFeatures>
</configuration>
</execution>
<execution>
<id>build-kar</id>
<phase>package</phase>
<goals>
<!--
Build a kar archive (Jar containing the feature.xml
as well as the module content and it's dependencies.
-->
<goal>kar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
<Bundle-Activator>org.apache.plc4x.java.osgi.DriverActivator</Bundle-Activator>
<Export-Service>org.apache.plc4x.java.api.PlcDriver,org.apache.plc4x.protocol.test
</Export-Service>
<Import-Package>
*
</Import-Package>
</instructions>
</configuration>
</plugin>
</plugin-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<usedDependencies combine.children="append">
<usedDependency>org.apache.plc4x:plc4x-code-generation-language-java</usedDependency>
<usedDependency>org.apache.plc4x:plc4x-code-generation-language-python</usedDependency>
<usedDependency>org.apache.plc4x:plc4x-code-generation-protocol-test</usedDependency>
</usedDependencies>
</configuration>
Expand Down Expand Up @@ -137,44 +90,9 @@
</build>

<dependencies>
<dependency>
<groupId>org.apache.plc4x</groupId>
<artifactId>plc4j-api</artifactId>
<version>@project.version@</version>
</dependency>

<dependency>
<groupId>org.apache.plc4x</groupId>
<artifactId>plc4j-spi</artifactId>
<version>@project.version@</version>
</dependency>

<dependency>
<groupId>org.apache.plc4x</groupId>
<artifactId>plc4j-transport-tcp</artifactId>
<version>@project.version@</version>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>

<dependency>
<groupId>org.apache.plc4x</groupId>
<artifactId>plc4j-utils-test-utils</artifactId>
<version>@project.version@</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.plc4x</groupId>
<artifactId>plc4x-code-generation-language-java</artifactId>
<artifactId>plc4x-code-generation-language-python</artifactId>
<version>@project.version@</version>
<!-- Scope is 'provided' as this way it's not shipped with the driver -->
<scope>provided</scope>
Expand Down
28 changes: 15 additions & 13 deletions tools/release-3-perform-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,34 @@ fi

# 2. Sign all artifacts
echo "Signing artifacts:"
find ./out/.local-artifacts-dir -print | grep -E '^((.*\.pom)|(.*\.jar)|(.*\.kar)|(.*\.nar)|(.*-features\.xml)|(.*-cycloneds\.json)|(.*-cycloneds\.xml)|(.*-site\.xml)|(.*\.zip))$' | while read -r line ; do
find ../out/.local-artifacts-dir -print | grep -E '^((.*\.pom)|(.*\.jar)|(.*\.kar)|(.*\.nar)|(.*-features\.xml)|(.*-cyclonedx\.json)|(.*-cyclonedx\.xml)|(.*-site\.xml)|(.*\.zip))$' | while read -r line ; do
echo "Processing $line"
gpg -ab "$line"
done

# 3. Deploy the artifacts to Nexus
echo "Deploying artifacts:"
../mvnw -f jenkins.pom -X -P deploy-releases wagon:upload
if [ $? -ne 0 ]; then
echo "Got non-0 exit code from maven deployment, aborting."
exit 1
fi
../mvnw -f ../jenkins.pom -X -P deploy-releases wagon:upload

# 4. Prepare a directory for the release candidate
echo "Staging release candidate:"
read -r -p 'Release-Candidate number: ' rcNumber
RELEASE_CANDIDATE="rc$rcNumber"
RELEASE_VERSION=$(find ../out/.local-artifacts-dir/org/apache/plc4x/plc4x-parent/ -maxdepth 1 -type d | grep -vE 'plc4x-parent/$' | xargs -n 1 basename)
mkdir -p "../out/stage/${RELEASE_VERSION}/rc1"
cp ../README.md "../out/stage/${RELEASE_VERSION}/rc1/README"
cp ../RELEASE_NOTES "../out/stage/${RELEASE_VERSION}/rc1"
cp "../out/.local-artifacts-dir/org/apache/plc4x/plc4x-parent/${RELEASE_VERSION}/plc4x-parent-${RELEASE_VERSION}-source-release.zip" "../out/stage/${RELEASE_VERSION}/rc1/apache-plc4x-${RELEASE_VERSION}-source-release.zip"
cp "../out/.local-artifacts-dir/org/apache/plc4x/plc4x-parent/${RELEASE_VERSION}/plc4x-parent-${RELEASE_VERSION}-source-release.zip.asc" "../out/stage/${RELEASE_VERSION}/rc1/apache-plc4x-${RELEASE_VERSION}-source-release.zip.asc"
cp "../out/.local-artifacts-dir/org/apache/plc4x/plc4x-parent/${RELEASE_VERSION}/plc4x-parent-${RELEASE_VERSION}-source-release.zip.sha512" "../out/stage/${RELEASE_VERSION}/rc1/apache-plc4x-${RELEASE_VERSION}-source-release.zip.sha512"
mkdir -p "../out/stage/${RELEASE_VERSION}/${RELEASE_CANDIDATE}"
cp ../README.md "../out/stage/${RELEASE_VERSION}/${RELEASE_CANDIDATE}/README"
cp ../RELEASE_NOTES "../out/stage/${RELEASE_VERSION}/${RELEASE_CANDIDATE}"
cp "../out/.local-artifacts-dir/org/apache/plc4x/plc4x-parent/${RELEASE_VERSION}/plc4x-parent-${RELEASE_VERSION}-source-release.zip" "../out/stage/${RELEASE_VERSION}/${RELEASE_CANDIDATE}/apache-plc4x-${RELEASE_VERSION}-source-release.zip"
cp "../out/.local-artifacts-dir/org/apache/plc4x/plc4x-parent/${RELEASE_VERSION}/plc4x-parent-${RELEASE_VERSION}-source-release.zip.asc" "../out/stage/${RELEASE_VERSION}/${RELEASE_CANDIDATE}/apache-plc4x-${RELEASE_VERSION}-source-release.zip.asc"
cp "../out/.local-artifacts-dir/org/apache/plc4x/plc4x-parent/${RELEASE_VERSION}/plc4x-parent-${RELEASE_VERSION}-source-release.zip.sha512" "../out/stage/${RELEASE_VERSION}/${RELEASE_CANDIDATE}/apache-plc4x-${RELEASE_VERSION}-source-release.zip.sha512"
cp "../out/.local-artifacts-dir/org/apache/plc4x/plc4x-parent/${RELEASE_VERSION}/plc4x-parent-${RELEASE_VERSION}-cyclonedx.json" "../out/stage/${RELEASE_VERSION}/${RELEASE_CANDIDATE}/apache-plc4x-${RELEASE_VERSION}-cyclonedx.json"
cp "../out/.local-artifacts-dir/org/apache/plc4x/plc4x-parent/${RELEASE_VERSION}/plc4x-parent-${RELEASE_VERSION}-cyclonedx.json.asc" "../out/stage/${RELEASE_VERSION}/${RELEASE_CANDIDATE}/apache-plc4x-${RELEASE_VERSION}-cyclonedx.json.asc"
cp "../out/.local-artifacts-dir/org/apache/plc4x/plc4x-parent/${RELEASE_VERSION}/plc4x-parent-${RELEASE_VERSION}-cyclonedx.xml" "../out/stage/${RELEASE_VERSION}/${RELEASE_CANDIDATE}/apache-plc4x-${RELEASE_VERSION}-cyclonedx.xml"
cp "../out/.local-artifacts-dir/org/apache/plc4x/plc4x-parent/${RELEASE_VERSION}/plc4x-parent-${RELEASE_VERSION}-cyclonedx.xml.asc" "../out/stage/${RELEASE_VERSION}/${RELEASE_CANDIDATE}/apache-plc4x-${RELEASE_VERSION}-cyclonedx.xml.asc"

# 5. Upload the release candidate artifacts to SVN
cd "../out/stage/${RELEASE_VERSION}" || exit
svn import rc1 "https://dist.apache.org/repos/dist/dev/plc4x/${RELEASE_VERSION}/rc1" -m"Staging of rc1 of PLC4X ${RELEASE_VERSION}"
svn import "${RELEASE_CANDIDATE}" "https://dist.apache.org/repos/dist/dev/plc4x/${RELEASE_VERSION}/${RELEASE_CANDIDATE}" -m"Staging of ${RELEASE_CANDIDATE} of PLC4X ${RELEASE_VERSION}"

# 6. Close the Nexus staging repository

Expand Down

0 comments on commit 04ece29

Please sign in to comment.