Skip to content

Commit

Permalink
Merge pull request #5 from swisspost/develop
Browse files Browse the repository at this point in the history
merge to master to trigger release
  • Loading branch information
dominik-cnx authored Jan 24, 2024
2 parents bd0f2a0 + 503b424 commit 8fae0c8
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 116 deletions.
37 changes: 29 additions & 8 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Java CI

on: [push]
on:
workflow_dispatch:
push:
pull_request:
branches: [ "master", "develop" ]

jobs:
build:
Expand All @@ -13,11 +17,28 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Deploy to Github Package Registry
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/jsons2xsd-maven-plugin'
run: |
curl -s https://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_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
mvn --settings settings.xml deploy
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.

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/jsons2xsd-maven-plugin" ]
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 -PpublicRepos 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
13 changes: 10 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.swisspush.maven.plugins</groupId>
<artifactId>jsons2xsd-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>1.0.2-SNAPSHOT</version>
<version>1.0.3-SNAPSHOT</version>
<name>jsons2xsd Maven Mojo</name>
<description>jsons2xsd Maven Mojo</description>
<url>https://github.com/swisspush/jsons2xsd-maven-plugin</url>
Expand Down Expand Up @@ -83,6 +82,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 @@ -230,6 +233,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
48 changes: 0 additions & 48 deletions settings.xml

This file was deleted.

0 comments on commit 8fae0c8

Please sign in to comment.