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

Mslres 4940 nexus release #25

Merged
merged 23 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7667a1b
MSLRES-4940 Add parent pom
May 19, 2022
aa25250
MSLRES-4940 Prepare pom for release
May 19, 2022
6e5006c
MSLRES-4940 Bump nexus staging maven plugin and use it as described i…
May 19, 2022
a8ebe67
MSLRES-4940 Add WIP release script
May 19, 2022
33e80e7
MSLRES-4940 Move parent to child pom
May 20, 2022
8c45801
MSLRES-4940 Use gpgagent to avoid manual pw entry
May 20, 2022
31202e3
MSLRES-4940 Prepare for github actions
May 20, 2022
64472e6
MSLRES-4940 Bump maven gpg plugin
May 20, 2022
4e1e6ad
MSLRES-4940 Improve naming of variables
May 20, 2022
435b1e4
MSLRES-4940 Read repo url from env
May 20, 2022
c097c53
MSLRES-4940 Read gpg passphrase from env
May 20, 2022
c73cc83
MSLRES-4940 Clean up release script
May 20, 2022
0663679
MSLRES-4940 Prepare for 1.1.0 re-release
May 20, 2022
6eb16ee
[maven-release-plugin] prepare release v1.1.0
May 20, 2022
166d7c2
[maven-release-plugin] prepare for next development iteration
May 20, 2022
a1d146c
MSLRES-4940 Add codeowners
May 20, 2022
776372f
MSLRES-4940 Change default serverId to clx-releases instead of snapshot
May 23, 2022
ecf1c91
MSLRES-4940 Rename public release profile
May 23, 2022
05eac60
MSLRES-4940 Switch back to git (SSH) protocol instead of https for scm
May 23, 2022
4635df5
MSLRES-4940 Add newlines to files
May 23, 2022
754cd0c
MSLRES-4940 Remove unnecessary flag
May 23, 2022
02bbc26
MSLRES-4940 Allow making public release using release script
May 23, 2022
6437467
MSLRES-4940 Improve readability and UX of bash script
May 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @thomasf147 @zuzmaczek @sunsee18 @GSvensk @gkvasnsinch
93 changes: 74 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.sinch</groupId>
<artifactId>sdk-sms</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.1.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>SDK for Sinch SMS</name>
<description>Library providing a Java API for the Sinch HTTP REST Messaging API.</description>
Expand All @@ -20,6 +20,68 @@
</license>
</licenses>

<profiles>
<profile>
<id>internal-release</id>
<activation>
<property>
<name>useInternalRepo</name>
<value>true</value>
</property>
</activation>
<properties>
</properties>
<distributionManagement>
<repository>
<id>clx-releases</id>
<url>${env.REPO_URL}/repository/clx-releases-hosted/</url>
</repository>
<snapshotRepository>
<id>clx-snapshots</id>
<url>${env.REPO_URL}/repository/clx-snapshots-hosted/</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>clx-releases</serverId>
<nexusUrl>${env.REPO_URL}</nexusUrl>
<skipStaging>true</skipStaging>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>public-release</id>
<activation>
<property>
<name>!useInternalRepo</name>
</property>
</activation>
<properties>
</properties>
<distributionManagement>
<repository>
<id>ossrh</id>
<name>Maven Central Staging Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<name>Maven Central Snapshot Repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</profile>
</profiles>

<scm>
<url>https://github.com/sinch/sinch-java-sms</url>
<connection>scm:git:git://github.com/sinch/sinch-java-sms.git</connection>
Expand Down Expand Up @@ -63,22 +125,8 @@
<owasp.suppression.file>${basedir}/suppression.xml</owasp.suppression.file>
</properties>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<name>Maven Central Snapshot Repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<name>Maven Central Staging Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down Expand Up @@ -119,7 +167,15 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>3.0.1</version>
<configuration>
<passphrase>${env.GPG_PASSPHRASE}</passphrase>
<gpgArguments>
<arg>--batch</arg>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down Expand Up @@ -213,9 +269,8 @@
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<tagNameFormat>v@{project.version}</tagNameFormat>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>release</releaseProfiles>
<goals>deploy</goals>
<useReleaseProfile>true</useReleaseProfile>
<releaseProfiles>internal-release</releaseProfiles>
</configuration>
</plugin>

Expand Down
37 changes: 37 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh

set -eu

INTERNAL_RELEASE=true

# Parses command line arguments
# If called with -p, a public release is made
# If called with -h, help text is displayed
# If called without any arg, an internal release is made
while getopts 'ph' OPTION; do
gkvasnsinch marked this conversation as resolved.
Show resolved Hide resolved
case "$OPTION" in
p)
INTERNAL_RELEASE=false
;;
?)
echo "Makes an internal release, unless -p (public) flag is set. script usage: $(basename "$0") [-h] [-p]" >&2
exit 1
;;
esac
done
shift "$((OPTIND -1))"

# Checks that required environment variables are set
[ -z "$REPO_URL" ] && echo "Need to set REPO_URL" && exit 1;
[ -z "$GPG_PASSPHRASE" ] && echo "Need to set GPG_PASSPHRASE" && exit 1;

if [ "$INTERNAL_RELEASE" = true ] ; then
echo "Making internal release"
gkvasnsinch marked this conversation as resolved.
Show resolved Hide resolved
else
echo "Making public release"
fi

# Make release
mvn release:clean
mvn release:prepare --batch-mode "-Darguments=-DskipTests -Ddependency-check.skip=true"
mvn release:perform "-Darguments=-DskipTests -DuseInternalRepo=${INTERNAL_RELEASE}"