Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #70 from JulianPSchmitt/github_Actions
Browse files Browse the repository at this point in the history
GitHub actions
  • Loading branch information
radsoulbeard authored Mar 18, 2022
2 parents 6df280e + 6a49829 commit bcbd259
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 3 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build-publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release - Maven Build and publish to Central

on:
push:
branches:
- release

jobs:
Deploy:
runs-on: ubuntu-latest

steps:
- name: Step 1 - Checkout release branch from GitHub
uses: actions/checkout@v2

- name: Step 2 - Set up Apache Maven Central
uses: actions/setup-java@v2
with: # running setup-java again overwrites the settings.xml
java-version: '8'
distribution: 'adopt'
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: OSSRH_JIRA_USERNAME # env variable for username in deploy
server-password: OSSRH_JIRA_PASSWORD # env variable for token in deploy
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: GPG_PASSPHRASE # env variable for GPG Passphrase

- name: Step 3 - Verify with Maven
run: |
export GPG_TTY=$(tty)
echo "[INFO] Running with profile: signing"
mvn --batch-mode --settings cfg/settings.xml -P signing clean verify
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Step 4 - Check Project-Version
run: |
mkdir tmp/
export PROJECT_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec`
tar -C tmp -xvf modules/dist.cli/target/dist.cli-${PROJECT_VERSION}.tar.gz
tmp/bin/cmclient --version | grep -q "^${PROJECT_VERSION}"
- name: Step 5 - Publish package
run: mvn --batch-mode clean deploy --settings cfg/settings.xml -P signing -DstagingProfileId=22fbc0443d9154
env:
OSSRH_JIRA_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }}
OSSRH_JIRA_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

2 changes: 1 addition & 1 deletion .github/workflows/maven-build-test-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: |
echo "[INFO]: Not preparing code signing."
echo "[INFO] Running with profile: noop"
mvn --settings cfg/settings.xml -P noop clean verify
mvn --batch-mode --settings cfg/settings.xml -P noop clean verify
- name: Step 4 - Check Project-Version
run: |
Expand Down
1 change: 0 additions & 1 deletion cfg/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<id>signing</id>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.keyname>${env.GPG_KEY_NAME}</gpg.keyname>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import com.google.common.collect.Sets;

import sap.ai.st.cm.plugins.ciintegration.odataclient.CMODataSolmanClient;
import sap.ai.st.cm.plugins.ciintegration.odataclient.CMODataSolmanClient;

/**
* Helpers for using/calling commands.
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
Expand Down

0 comments on commit bcbd259

Please sign in to comment.