-
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
chensoul
committed
Dec 7, 2023
1 parent
6fd530c
commit 0dccfac
Showing
7 changed files
with
418 additions
and
53 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,71 @@ | ||
{ | ||
"categories": [ | ||
{ | ||
"title": "## 🚀 Features", | ||
"labels": [ | ||
"feature", | ||
"minor", | ||
"major" | ||
], | ||
"exclude_labels": [ | ||
"fix", | ||
"patch" | ||
] | ||
}, | ||
{ | ||
"title": "## 🐛 Fixes", | ||
"labels": [ | ||
"fix", | ||
"patch" | ||
], | ||
"exclude_labels": [ | ||
"feature", | ||
"minor", | ||
"major" | ||
] | ||
}, | ||
{ | ||
"title": "## 🐛 Wiki", | ||
"labels": [ | ||
"wiki" | ||
] | ||
}, | ||
{ | ||
"title": "## 🐛 Test", | ||
"labels": [ | ||
"test" | ||
], | ||
"exclude_labels": [ | ||
"feature", | ||
"fix", | ||
"minor", | ||
"patch", | ||
"major" | ||
] | ||
}, | ||
{ | ||
"title": "## 🧪 Github", | ||
"labels": [ | ||
"github" | ||
] | ||
}, | ||
{ | ||
"title": "## 💬 Other", | ||
"labels": [ | ||
"other" | ||
] | ||
}, | ||
{ | ||
"title": "## 📦 Dependencies", | ||
"labels": [ | ||
"dependencies" | ||
] | ||
} | ||
], | ||
"sort": "ASC", | ||
"template": "${{CHANGELOG}}", | ||
"pr_template": "- ${{TITLE}}\n - PR: #${{NUMBER}}", | ||
"empty_template": "- no changes", | ||
"max_pull_requests": 1000, | ||
"max_back_track_time_days": 1000 | ||
} |
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,69 @@ | ||
# https://github.com/marketplace/actions/release-changelog-builder | ||
name: 'Github Release' | ||
|
||
on: | ||
repository_dispatch: | ||
types: [release-notes] | ||
|
||
concurrency: | ||
group: ${{ github.event.pull_request.number }}-ci | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
release-notes: | ||
if: github.event.client_payload.auto_release == 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Get Latest Release Tag | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
echo "latest_release_tag=$(curl -sL \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${GITHUB_TOKEN}"\ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/repos/${{github.event.repository.owner.login}}/${{github.event.repository.name}}/releases/latest | jq -r '.tag_name')" >> $GITHUB_ENV | ||
echo "currentTag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV | ||
- name: Build Changelog | ||
id: github_release | ||
uses: mikepenz/release-changelog-builder-action@v2 | ||
with: | ||
configuration: ".github/configs/configuration_repo.json" | ||
fromTag: ${{env.latest_release_tag}} | ||
toTag: ${{env.currentTag}} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body: ${{steps.github_release.outputs.changelog}} | ||
tag_name: ${{env.currentTag}} | ||
- name: Artifact Information | ||
id: artifact_information | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
run: | | ||
echo "archive_download_url=$(curl -sSL \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${GITHUB_TOKEN}"\ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/repos/${{github.event.repository.owner.login}}/${{github.event.repository.name}}/actions/artifacts | jq -r '.artifacts[0].archive_download_url')" >> $GITHUB_ENV | ||
- name: Download Artifact | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
curl -sSL \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${GITHUB_TOKEN}"\ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
${{ env.archive_download_url }} -o ${{ github.event.client_payload.artifact }}.zip | ||
- name: Upload Assets to Release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ${{ github.event.client_payload.artifact }}.zip | ||
tag: ${{env.currentTag}} |
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,81 @@ | ||
name: 'Maven Release' | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseVersion: | ||
description: "Define the release version" | ||
required: true | ||
default: "" | ||
developmentVersion: | ||
description: "Define the snapshot version" | ||
required: true | ||
default: "" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Maven Central Repository | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 11 | ||
distribution: 'temurin' | ||
java-package: 'jdk' | ||
cache: 'maven' | ||
server-id: ossrh | ||
- name: Configure Git User | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "GitHub Actions" | ||
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
- name: Import GPG Key | ||
uses: crazy-max/[email protected] | ||
with: | ||
gpg_private_key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | ||
- name: Verify Whether a Release is Ready | ||
shell: bash | ||
run: | | ||
if [ "${{ github.event.inputs.releaseVersion }}" != "" ] && [ "${{ github.event.inputs.developmentVersion }}" != "" ]; then | ||
echo "auto_release=true" >> $GITHUB_ENV | ||
else | ||
echo "auto_release=false" >> $GITHUB_ENV | ||
fi | ||
- name: Artifact Version | ||
shell: bash | ||
run: | | ||
echo "artifact_version=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)" >> "$GITHUB_ENV" | ||
- name: Release With Maven | ||
run: | | ||
mvn -B -U \ | ||
release:prepare \ | ||
release:perform \ | ||
-DreleaseVersion=${{ github.event.inputs.releaseVersion }} \ | ||
-DdevelopmentVersion=${{ github.event.inputs.developmentVersion }} \ | ||
deploy \ | ||
-s settings.xml \ | ||
-Prelease \ | ||
-Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }} | ||
env: | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} | ||
AUTO_RELEASE_AFTER_CLOSE: ${{ env.auto_release }} | ||
- name: Artifact Name | ||
shell: bash | ||
run: | | ||
echo "artifact_name=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.artifactId -q -DforceStdout)" >> "$GITHUB_ENV" | ||
echo "${{ env.artifact_name }} ${{ env.artifact_version }}" | ||
ls -al ./target/ | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.artifact_name }}-${{ env.artifact_version }} | ||
path: ./target/${{ env.artifact_name }}-${{ env.artifact_version }}.jar | ||
- name: Workflow Release Notes | ||
uses: peter-evans/repository-dispatch@v2 | ||
if: ${{ github.event.inputs.releaseVersion }} != "" && ${{ github.event.inputs.developmentVersion }} != "" | ||
with: | ||
event-type: release-notes | ||
client-payload: '{"auto_release": "${{ env.auto_release }}", "artifact": "${{ env.artifact_name }}-${{ env.artifact_version }}"}' |
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,32 @@ | ||
name: 'Maven Verify' | ||
|
||
on: | ||
- 'pull_request' | ||
- 'push' | ||
|
||
jobs: | ||
job-mvn-verify: | ||
name: 'Job: Maven Verify' | ||
permissions: | ||
contents: 'read' | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- id: 'checkout' | ||
name: 'Step: Checkout' | ||
uses: 'actions/checkout@v4' | ||
with: | ||
fetch-depth: 1 | ||
persist-credentials: false | ||
- id: 'setup-java' | ||
name: 'Step: Set Up Java and Maven' | ||
uses: 'actions/setup-java@v3' | ||
with: | ||
cache: 'maven' | ||
distribution: 'temurin' | ||
java-version: '11' | ||
- id: 'mvn-verify' | ||
name: 'Step: Maven Verify' | ||
# -U force updates just to make sure we are using latest dependencies | ||
# -B Batch mode (do not ask for user input), just in case | ||
# -P activate profile | ||
run: 'mvn -U -B -e -ntp verify' |
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.