Merge pull request #28 from swisspost/develop #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
push: | |
branches: | |
- master | |
env: | |
RELEASE_VERSION: "0.4.23" | |
DEVELOP_VERSION: "0.4.24-SNAPSHOT" | |
GIT_AUTHOR_NAME: "@swisspost-devs" | |
GIT_AUTHOR_EMAIL: "[email protected]" | |
GIT_COMMITTER_NAME: "swisspost-devs" | |
GIT_COMMITTER_EMAIL: "[email protected]" | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 1.8 | |
uses: joschi/setup-jdk@v2 | |
with: | |
java-version: '8' | |
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: Release | |
if: ${{ !contains(github.event.head_commit.message, '[maven-release-plugin]') }} | |
run: | | |
echo "Preparing release ${RELEASE_VERSION}..." | |
mvn -B release:prepare -Pdo-release -DreleaseVersion=${RELEASE_VERSION} -DdevelopmentVersion=${DEVELOP_VERSION} | |
mvn release:perform -Pdo-release | |
env: | |
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} | |
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }} | |
CI_GPG_PASSPHRASE: ${{ secrets.CI_GPG_PASSPHRASE }} | |
- name: Merge back to develop | |
run: | | |
git fetch --depth 1 origin develop | |
git checkout develop | |
git fetch --shallow-since="$(git show -s --format=%ci develop)" origin master develop | |
git merge master --no-edit | |
git push origin develop |