Skip to content

Commit

Permalink
Merge pull request #23 from swisspost/develop
Browse files Browse the repository at this point in the history
develop to master to trigger release
  • Loading branch information
dominik-cnx authored Feb 7, 2023
2 parents 7c8b989 + 9c7f688 commit e238c0e
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 87 deletions.
46 changes: 34 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,42 @@
name: Publish package to GitHub Packages
on:
release:
types: [created]
workflow_dispatch:
push:
pull_request:
branches: [ "master", "develop" ]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Publish package
run: mvn --batch-mode deploy
java-version: '17'
distribution: 'temurin'
server-id: sonatype-nexus-staging # Value of the distributionManagement/repository/id field of the pom.xml
server-username: CI_DEPLOY_USERNAME # env variable for username in deploy
server-password: CI_DEPLOY_PASSWORD # env variable for token in deploy
gpg-private-key: ${{ secrets.CI_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: CI_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Install, unit test, integration test
run: mvn install -Dmaven.javadoc.skip=true -B -V

- name: Release to maven central
if: github.ref_name == 'master' && github.event_name != 'pull_request' && github.repository == 'swisspost/kobuka'
run: |
curl -s get.sdkman.io | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install groovy 3.0.8
chmod +x ./maybe-release.sh
./maybe-release.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
CI_GPG_PASSPHRASE: ${{ secrets.CI_GPG_PASSPHRASE }}

- name: After release
run: bash <(curl -s https://codecov.io/bash)
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion kobuka-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>kobuka</artifactId>
<groupId>org.swisspush</groupId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kobuka-gen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>kobuka</artifactId>
<groupId>org.swisspush</groupId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.common.config.ConfigDef;
import org.apache.kafka.common.config.SaslConfigs;
import org.apache.kafka.common.config.SslConfigs;
import org.apache.kafka.common.config.types.Password;
import org.apache.kafka.streams.StreamsConfig;

Expand Down Expand Up @@ -50,6 +52,11 @@ public static void main(String[] args) throws IOException {
commonKeys.retainAll(AdminClientConfig.configDef().configKeys().keySet());
commonKeys.retainAll(StreamsConfig.configDef().configKeys().keySet());

ConfigDef commonConfigs = new ConfigDef();
SaslConfigs.addClientSaslSupport(commonConfigs);
SslConfigs.addClientSslSupport(commonConfigs);
commonKeys.addAll(commonConfigs.configKeys().keySet());

Stream<Map.Entry<String, ConfigDef.ConfigKey>> commonConfigMap = AdminClientConfig.configDef().configKeys().entrySet().stream()
.filter(entry -> commonKeys.contains(entry.getKey()));

Expand Down
2 changes: 1 addition & 1 deletion kobuka-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>kobuka</artifactId>
<groupId>org.swisspush</groupId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
62 changes: 27 additions & 35 deletions maybe-release.sh
Original file line number Diff line number Diff line change
@@ -1,42 +1,34 @@
#!/bin/bash
set -ev
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_REPO_SLUG" == "swisspush/kobuka" ]
git fetch
git reset --hard
groovy staging.groovy drop
rc=$?
if [ $rc -ne 0 ]
then
git reset --hard
git clean -fd
git checkout master
echo 'Master checked out'
groovy staging.groovy drop
echo 'problem when trying to drop, ignored'
fi
echo 'starting a new nexus repository ...'
OUTPUT=$(groovy staging.groovy start)
echo "repository Id: $OUTPUT"
mvn -B -Prelease jgitflow:release-start jgitflow:release-finish -DrepositoryId=${OUTPUT}
rc=$?
if [ $rc -eq 0 ]
then
groovy staging.groovy close ${OUTPUT}
groovy staging.groovy promote ${OUTPUT}
rc=$?
if [ $rc -ne 0 ]
then
echo 'problem when trying to drop, ignored'
fi
echo 'starting a new nexus repository ...'
OUTPUT=$(groovy staging.groovy start)
echo "repository Id: $OUTPUT"
mvn -B -Prelease jgitflow:release-start jgitflow:release-finish --settings settings.xml -DrepositoryId=${OUTPUT}
rc=$?
if [ $rc -eq 0 ]
then
groovy staging.groovy close ${OUTPUT}
groovy staging.groovy promote ${OUTPUT}
rc=$?
if [ $rc -ne 0 ]
then
echo 'Release failed, cannot promote stage'
exit rc
fi
echo 'Release done, will push'
git tag
git push --tags
git checkout develop
git push origin develop
exit 0
echo 'Release failed, cannot promote stage'
exit $rc
fi
echo 'Release failed'
exit rc
else
echo 'Release skipped'
exit 0
fi
echo 'Release done, will push'
git tag
git push --tags
git checkout develop
git push origin develop
exit 0
fi
echo 'Release failed'
exit $rc
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.swisspush</groupId>
<artifactId>kobuka</artifactId>
<packaging>pom</packaging>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.3-SNAPSHOT</version>
<name>kobuka</name>
<description>Config Builders for Kafka. A fluent API for configuring kafka clients.</description>
<url>https://github.com/swisspush/kobuka</url>
Expand Down Expand Up @@ -60,6 +60,10 @@
<homedir>${session.executionRootDirectory}</homedir>
<keyname>230584D7</keyname>
<!--<executable>C:\Program Files (x86)\GnuPG\bin\gpg.exe</executable>-->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
Expand Down Expand Up @@ -253,6 +257,10 @@
<homedir>${session.executionRootDirectory}</homedir>
<keyname>230584D7</keyname>
<!--<executable>C:\Program Files (x86)\GnuPG\bin\gpg.exe</executable>-->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
Expand Down
14 changes: 0 additions & 14 deletions settings.xml

This file was deleted.

0 comments on commit e238c0e

Please # to comment.