-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2626aea
commit a20823f
Showing
4 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# | ||
# This script takes care of deploying tagged versions to maven central and updating the pom.xml | ||
# version with next development version. | ||
# | ||
# Required environment variables: GPG_SECRET_KEYS, GPG_OWNERTRUST, GPG_EXECUTABLE | ||
|
||
set -eo pipefail | ||
|
||
echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --batch --import | ||
echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --batch --import-ownertrust | ||
mvn --batch-mode deploy -Prelease -DskipTests --settings .github/settings.xml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# | ||
# This script checks that the version number of the release is an expected one, and avoid erroneous releases which don't follow semver | ||
set -eo pipefail | ||
|
||
git fetch --tags --quiet | ||
VERSION="$1" | ||
PREV_VERSION=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`) | ||
PREV_VERSION=${PREV_VERSION#v} | ||
PREV_MAJOR="${PREV_VERSION%%.*}" | ||
PREV_VERSION="${PREV_VERSION#*.}" | ||
PREV_MINOR="${PREV_VERSION%%.*}" | ||
PREV_PATCH="${PREV_VERSION#*.}" | ||
if [[ "$PREV_VERSION" == "$PREV_PATCH" ]]; then | ||
PREV_PATCH="0" | ||
fi | ||
|
||
[[ "$VERSION" == "$PREV_MAJOR.$PREV_MINOR.$((PREV_PATCH + 1))" || "$VERSION" == "$PREV_MAJOR.$((PREV_MINOR + 1))" || "$VERSION" == "$((PREV_MAJOR + 1)).0" ]] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 | ||
https://maven.apache.org/xsd/settings-1.0.0.xsd"> | ||
|
||
<servers> | ||
<server> | ||
<id>ossrh</id> | ||
<username>${env.SONATYPE_USERNAME}</username> | ||
<password>${env.SONATYPE_PASSWORD}</password> | ||
</server> | ||
</servers> | ||
|
||
<profiles> | ||
<profile> | ||
<id>ossrh</id> | ||
<activation> | ||
<activeByDefault>true</activeByDefault> | ||
</activation> | ||
<properties> | ||
<gpg.executable>${env.GPG_EXECUTABLE}</gpg.executable> | ||
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
|
||
</settings> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: publish release | ||
on: | ||
release: | ||
types: [ published ] | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
concurrency: blazemeter_test | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Java 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Get version | ||
id: version | ||
run: echo "release_version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | ||
- name: Check version | ||
run: .github/semver-check.sh ${{ env.release_version }} | ||
- name: set maven project version | ||
run: mvn --batch-mode --no-transfer-progress versions:set -DnewVersion=${{ env.release_version }} --settings .github/settings.xml | ||
- name: package release | ||
run: mvn --batch-mode --no-transfer-progress clean package --settings .github/settings.xml | ||
- name: Upload built jar into release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: target/*.jar | ||
file_glob: true | ||
tag: ${{ github.ref }} | ||
- name: publish to Nexus | ||
run: .github/maven-central-deploy.sh | ||
env: | ||
GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }} | ||
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }} | ||
GPG_EXECUTABLE: gpg | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} |