-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #12078: Github action Release prepare
- Loading branch information
1 parent
c0b12ee
commit 527bae7
Showing
2 changed files
with
59 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,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [[ -z $1 ]]; then | ||
echo "version is not set" | ||
echo "Usage: maven-prepare.sh <version>" | ||
exit 1 | ||
fi | ||
|
||
TARGET_VERSION=$1 | ||
echo TARGET_VERSION="$TARGET_VERSION" | ||
|
||
CURRENT_VERSION=$(xmlstarlet sel -N pom=http://maven.apache.org/POM/4.0.0 \ | ||
-t -m pom:project -v pom:version pom.xml | sed "s/-SNAPSHOT//") | ||
echo CURRENT_VERSION="$CURRENT_VERSION" | ||
|
||
if [ "$TARGET_VERSION" != "$CURRENT_VERSION" ]; then | ||
echo "[ERROR] Target Version and Current Version doesn't match." | ||
exit 1; | ||
fi | ||
|
||
SKIP_TEST="-DskipTests -DskipITs" | ||
SKIP_CHECKSTYLE="-Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true" | ||
SKIP_OTHERS="-Dpmd.skip=true -Dspotbugs.skip=true -Djacoco.skip=true -Dxml.skip=true" | ||
|
||
echo "Version bump in pom.xml (release:prepare) ..." | ||
mvn -e --no-transfer-progress release:prepare -B \ | ||
-Darguments="$SKIP_TEST $SKIP_CHECKSTYLE $SKIP_OTHERS" |
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,30 @@ | ||
############################################################################# | ||
# GitHub Action to Run Maven Release Prepare. | ||
# | ||
############################################################################# | ||
name: "Maven Release Prepare" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Target Version without (-SNAPSHOT)' | ||
required: true | ||
jobs: | ||
prepare: | ||
name: Prepare Release ${{ github.event.inputs.version }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the latest code | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Download xmlstarlet | ||
run: | | ||
sudo apt-get install xmlstarlet | ||
- name: Commit and Push Credentials | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
- name: Run Shell Script | ||
run: | | ||
./.ci/maven-prepare.sh ${{ github.event.inputs.version }} |