-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore]: add auto release mvn package
Signed-off-by: stone1100 <[email protected]>
- Loading branch information
Showing
6 changed files
with
107 additions
and
16 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 @@ | ||
{ | ||
"categories":[ | ||
{ | ||
"title":"### 🚀 New features", | ||
"labels":[ | ||
"feature", | ||
"enhancement" | ||
] | ||
}, | ||
{ | ||
"title":"### 🐛 Bug fixes", | ||
"labels":[ | ||
"bug" | ||
] | ||
}, | ||
{ | ||
"title":"### 💬 Others", | ||
"exclude_labels":[ | ||
"feature", | ||
"enhancement", | ||
"bug" | ||
] | ||
} | ||
], | ||
"ignore_labels":[ | ||
"release_bot" | ||
], | ||
"pr_template":"- ${{TITLE}} by @${{AUTHOR}} in #${{NUMBER}}" | ||
} |
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 |
---|---|---|
@@ -1,26 +1,30 @@ | ||
name: Pushlish Java Client to OSSRH | ||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [released] | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
test-with-coverage: | ||
name: Publish package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: get latest release with tag | ||
id: latestrelease | ||
run: | | ||
echo "::set-output name=releasetag::$(curl -s https://api.github.com/repos/lindb/client_java/releases/latest | jq '.tag_name' | sed 's/\"//g')" | ||
- name: confirm release tag | ||
run: | | ||
echo ${{ steps.latestrelease.outputs.releasetag }} | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
ref: ${{ steps.latestrelease.outputs.releasetag }} | ||
ref: ${{ github.ref_name }} | ||
- name: Modify version | ||
id: version | ||
run: | | ||
VERSION=${{ github.ref_name }} | ||
echo "version=${VERSION:1}" >> $GITHUB_OUTPUT | ||
- name: Generate release changelog | ||
id: generate_changelog | ||
uses: mikepenz/[email protected] | ||
with: | ||
configuration: ".github/configuration.json" | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
|
@@ -31,10 +35,45 @@ jobs: | |
server-password: MAVEN_PASSWORD | ||
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key pcassphrase | ||
|
||
- name: Modify pom version | ||
run: | | ||
mvn versions:set -DnewVersion=${{ steps.version.outputs.version }} | ||
- name: Publish package | ||
run: mvn --batch-mode deploy -Dmaven.exec.skip=true | ||
run: mvn --batch-mode clean deploy -Dmaven.exec.skip=true | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
if: github.event_name != 'workflow_dispatch' | ||
with: | ||
release_name: ${{ github.ref_name }} | ||
body: "${{ steps.generate_changelog.outputs.changelog }}" | ||
- name: Checkout main | ||
run: | | ||
git fetch origin main | ||
git checkout main | ||
mvn versions:set -DnewVersion=${{ steps.version.outputs.version }} | ||
- name: Create changelog pull request | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
commit-message: "[chore]: modify version(${{ github.ref_name }})" | ||
branch: versions | ||
signoff: true | ||
delete-branch: true | ||
title: "[chore]: modify version(${{ github.ref_name }})" | ||
body: | | ||
Modify pom.xml version | ||
- Auto-generated by [create-pull-request][1] | ||
[1]: https://github.com/peter-evans/create-pull-request | ||
labels: | | ||
release_bot | ||
- name: Auto merge pull request | ||
if: steps.cpr.outputs.pull-request-operation == 'created' | ||
uses: peter-evans/enable-pull-request-automerge@v3 | ||
with: | ||
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | ||
merge-method: rebase | ||
|
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ target/* | |
*.iml | ||
.DS_Store | ||
.factorypath | ||
pom.xml.versionsBackup | ||
|
||
# Log file | ||
*.log | ||
|
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