Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 23 additions & 2 deletions .github/maintainers_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Maintaining this project requires installing [OpenJDK](https://openjdk.java.net/

### Testing

This project has tests for individual packages inside of each's respective `src/test/java` directory. All the tests under `test_locally` package are executed in every single GitHub Actions CI build as below.
This project has tests for individual packages inside each's respective `src/test/java` directory. All the tests under `test_locally` package are executed in every single GitHub Actions CI build as below.

```bash
./scripts/run_no_prep_tests.sh
Expand Down Expand Up @@ -109,7 +109,28 @@ Place `$HOME/.m2/settings.xml` with your Sonatype account information.
</settings>
```

#### Operations
#### Snapshot Release

Snapshot releases are intended for developers to make pre-release versions of their projects available for testing.
To learn more about snapshot releases in maven central repository check out [publish-portal-snapshots](https://central.sonatype.org/publish/publish-portal-snapshots/)

* From the upstream repository
* Preparation
* `git switch main && git pull origin main`
* Make sure there are no build failures at https://github.com/slackapi/java-slack-sdk/actions
* Set a new version
* It is **critical** that the version ends with `-SNAPSHOT`. This is how [central-publishing-maven-plugin](https://central.sonatype.org/publish/publish-portal-snapshots/#publishing-with-the-central-publishing-maven-plugin) automatically recognizes snapshot releases and uploads them the right location.
* If you don't have `gnu-sed`, check out [Prerequisites](#prerequisites)
* Run `scripts/set_version.sh (the version)` (e.g., `scripts/set_version.sh 1.0.0-SNAPSHOT`)
* Ship the libraries
* Switch to **JDK 17** to publish all modules (on macOS, you can run `export JAVA_HOME=$(/usr/libexec/java_home -v 17)` for it)
* Run `scripts/release.sh` (it takes a bit long)
* (If you encounter an error, log in https://oss.sonatype.org/ to check detailed information)
* No need to create a GitHub Release, since this is intended for developers to make pre-release versions of their projects.
* `-SNAPSHOT` versions are intended to be overwritten.
* This enables developers to work with the latest version of a library without needing to update their dependencies repeatedly.

#### Stable Release

* From the upstream repository
* Preparation
Expand Down
71 changes: 0 additions & 71 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -343,77 +343,6 @@
</plugins>
</build>
</profile>
<profile>
<id>snapshot-releases</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>${maven-release-plugin.version}</version>
<configuration>
<goals>deploy,site-deploy</goals>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>${lombok-maven-plugin.version}</version>
<configuration>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<outputDirectory>${delombok.output}</outputDirectory>
<addOutputDirectory>false</addOutputDirectory>
</configuration>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<source>8</source>
</configuration>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<additionalJOption>-Xdoclint:none</additionalJOption>
<sourcepath>${delombok.output}</sourcepath>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>building-with-jdk-17</id>
<activation>
Expand Down
22 changes: 16 additions & 6 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

is_jdk_8=`echo $JAVA_HOME | grep 8.`
is_travis_jdk_8=`echo $TRAVIS_JDK | grep openjdk8`
is_jdk_8=$(echo "$JAVA_HOME" | grep 8.)
is_travis_jdk_8=$(echo "$TRAVIS_JDK" | grep openjdk8)
if [[ "${is_jdk_8}" != "" && "${is_travis_jdk_8}" != "" ]];
then
echo "Please use OpenJDK 11 for releasing these libraries."
Expand All @@ -10,19 +10,29 @@ fi

exclusion="-pl !bolt-kotlin-examples -pl !bolt-quarkus-examples"

dir=`dirname $0`/..
release_version=`sed -n 's/<version>\([^\$]\..*\)<\/version>$/\1/p' < ${dir}/pom.xml`
dir=$(dirname "$0")/..
release_version=$(sed -n 's/^[[:space:]]*<version>\([^\$]\..*\)<\/version>[[:space:]]*$/\1/p' < "${dir}"/pom.xml)
Copy link

@vegeris vegeris Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, the update to this command* removes spaces that were being added to the release_version variable?

Based on local testing I got

% release_version=`sed -n 's/<version>\([^\$]\..*\)<\/version>$/\1/p' < pom.xml`          
% echo $release_version                                                                
    1.45.5-SNAPSHOT

# vs.
% release_version=$(sed -n 's/^[[:space:]]*<version>\([^\$]\..*\)<\/version>[[:space:]]*$/\1/p' < pom.xml) 
% echo $release_version                                                                                    
1.45.5-SNAPSHOT

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes exactly 🚀


export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"

if [[ "${release_version}" =~ ^.+-SNAPSHOT$ ]]; then
profile=snapshot-releases
echo "🚀 Releasing a SNAPSHOT version ($release_version) of the project."
profile=production-releases
mvn clean \
deploy \
-P snapshot-releases \
-P production-releases \
-D maven.test.skip=true \
${exclusion}
else
echo "You are releasing a stable version ($release_version) of the project."
read -r -p "This will be available publicly. Is this correct? (y/N): " confirmation

if [[ ! "$confirmation" =~ ^[Yy]$ ]]; then
echo "Release cancelled by user!"
exit 0
fi
echo "Confirmed. Proceeding with the stable release."

profile=production-releases
mvn clean \
deploy \
Expand Down