-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
22 changed files
with
97 additions
and
50 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 |
---|---|---|
|
@@ -14,11 +14,21 @@ on: | |
default: false | ||
type: boolean | ||
required: false | ||
testCoverageDryRun: | ||
description: 'dryrun coverage report?' | ||
default: false | ||
type: boolean | ||
required: false | ||
testVerbose: | ||
description: 'test output verbose' | ||
default: false | ||
type: boolean | ||
required: false | ||
applyQodanaScan: | ||
description: 'apply Qodana Scan?' | ||
default: true | ||
type: boolean | ||
required: false | ||
deployOssrh: | ||
description: 'deploy to ossrh?' | ||
default: true | ||
|
@@ -33,9 +43,13 @@ jobs: | |
release: | ||
name: Release to Sonatype | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
checks: write | ||
env: | ||
MAVEN_OPTS: -Xmx2g | ||
TEST_VERBOSE: ${{ inputs.testVerbose }} | ||
TEST_VERBOSE: ${{ inputs.testVerbose == 'true' }} | ||
|
||
steps: | ||
- name: Checkout ${{ github.event.release.tag_name }} | ||
|
@@ -63,31 +77,43 @@ jobs: | |
- name: Maven settings.xml | ||
id: settings | ||
run: | | ||
echo "# env and var" >> "$GITHUB_STEP_SUMMARY" | ||
echo "" >> "$GITHUB_STEP_SUMMARY" | ||
JAVA_HOME=$(asdf where java) | ||
echo "- JAVA_HOME=$JAVA_HOME" >> "$GITHUB_STEP_SUMMARY" | ||
echo "JAVA_HOME=$JAVA_HOME" >> "$GITHUB_OUTPUT" | ||
echo "- GIT_BRANCH=$(git branch --show-current)" >> "$GITHUB_STEP_SUMMARY" | ||
echo "GIT_BRANCH=$(git branch --show-current)" >> "$GITHUB_OUTPUT" | ||
_opt=$(git describe --tags --exact-match 2>/dev/null || true) | ||
if [ "$_opt" != "" ]; then | ||
_opt="-Drevision=$_opt" | ||
echo "MVN_REVISION=$_opt" | ||
echo "- MVN_REVISION=$_opt" >> "$GITHUB_STEP_SUMMARY" | ||
echo "MVN_REVISION=$_opt" >> "$GITHUB_OUTPUT" | ||
fi | ||
_ver=$(mvn --quiet --non-recursive -DforceStdout -Dexpression=project.version $_opt help:evaluate) | ||
echo "WINGS_VERSION=$_ver" | ||
echo "- WINGS_VERSION=$_ver" >> "$GITHUB_STEP_SUMMARY" | ||
echo "WINGS_VERSION=$_ver" >> "$GITHUB_OUTPUT" | ||
_cov=${{ inputs.testCoverReport || github.event_name == 'push' }} | ||
echo "MVN_COVERAGE=$_cov" | ||
echo "- MVN_COVERAGE=$_cov" >> "$GITHUB_STEP_SUMMARY" | ||
echo "MVN_COVERAGE=$_cov" >> "$GITHUB_OUTPUT" | ||
_drh=${{ inputs.deployOssrh || github.event_name == 'release' }} | ||
echo "MVN_DEPLOYRH=$_drh" | ||
echo "- MVN_DEPLOYRH=$_drh" >> "$GITHUB_STEP_SUMMARY" | ||
echo "MVN_DEPLOYRH=$_drh" >> "$GITHUB_OUTPUT" | ||
mvn -v | ||
git --no-pager log --graph -10 --pretty=format:'%H - %ai %d %s' | ||
_qod=${{ inputs.applyQodanaScan || 'false' }} | ||
echo "- QODANA_SCAN=$_qod" >> "$GITHUB_STEP_SUMMARY" | ||
echo "QODANA_SCAN=$_qod" >> "$GITHUB_OUTPUT" | ||
echo "# mvn and git" >> "$GITHUB_STEP_SUMMARY" | ||
echo "" >> "$GITHUB_STEP_SUMMARY" | ||
echo '```text' >> "$GITHUB_STEP_SUMMARY" | ||
mvn -v >> "$GITHUB_STEP_SUMMARY" | ||
git --no-pager log --graph -10 --pretty=format:'%H - %ai %d %s' >> "$GITHUB_STEP_SUMMARY" | ||
echo '```' >> "$GITHUB_STEP_SUMMARY" | ||
mkdir -p ~/.m2 | ||
cat > ~/.m2/settings.xml << "EOF" | ||
|
@@ -102,18 +128,27 @@ jobs: | |
</servers> | ||
</settings> | ||
EOF | ||
- name: Qodana Scan | ||
uses: JetBrains/[email protected] | ||
if: steps.settings.outputs.QODANA_SCAN == 'true' | ||
env: | ||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} | ||
## report if not release | ||
- name: Test Coverage ${{ steps.settings.outputs.WINGS_VERSION }} ${{ steps.settings.outputs.GIT_BRANCH }} | ||
if: steps.settings.outputs.MVN_COVERAGE == 'true' | ||
run: > | ||
mvn | ||
-P coverage | ||
-Dmaven.test.failure.ignore=${{ inputs.testFailureIgnore }} | ||
-DrepoToken=${{ secrets.COVERALLS_REPO_TOKEN }} | ||
-P 'coverage' | ||
-Dmaven.test.failure.ignore=$TESTFAILS_IGNORE | ||
-DrepoToken=$COVERALLS_WINGS -DdryRun=$COVERALLS_DRYRUN | ||
clean test jacoco:report coveralls:report | ||
env: | ||
TZ: Asia/Shanghai | ||
JAVA_HOME: ${{ steps.settings.outputs.JAVA_HOME }} | ||
COVERALLS_WINGS: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
COVERALLS_DRYRUN: ${{ inputs.testCoverageDryRun || 'false' }} | ||
TESTFAILS_IGNORE: ${{ inputs.testFailureIgnore || 'false' }} | ||
|
||
## import gpp private key | ||
- name: Import GPG key | ||
if: steps.settings.outputs.MVN_DEPLOYRH == 'true' | ||
|
@@ -127,7 +162,7 @@ jobs: | |
if: steps.settings.outputs.MVN_DEPLOYRH == 'true' | ||
run: > | ||
mvn | ||
-P ossrh | ||
-P 'ossrh' | ||
${{ steps.settings.outputs.MVN_REVISION }} | ||
-Dgpg.passphrase=${MVN_GPG_PASS} | ||
clean deploy | ||
|
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.