-
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.
feat: add workflow for creating release tags
新增支持通过 GitHub Actions 创建发布标签的工作流。 同时对现有工作流进行了重命名和优化,以更好区分任务用途。
- Loading branch information
1 parent
3c84524
commit 8184ebf
Showing
4 changed files
with
58 additions
and
2 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,52 @@ | ||
name: Create tag | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
prepare_tag: | ||
# Only proceed if the workflow dispatch event is for the "main" branch | ||
if: github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }} | ||
passphrase: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }} | ||
|
||
- name: Configure GPG for CI | ||
run: | | ||
mkdir -p ~/.gnupg | ||
chmod 700 ~/.gnupg | ||
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf | ||
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf | ||
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV | ||
- name: Test GPG signing | ||
run: | | ||
gpg -K | ||
echo "test gpg" > test.txt | ||
gpg -ab test.txt | ||
gpg --verify test.txt.asc | ||
rm test.txt test.txt.asc | ||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
server-id: central-portal | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_PASSWORD | ||
|
||
- name: Prepare release tag | ||
run: | | ||
./mvnw clean -Pcoding,auto-release release:prepare -B --settings .mvn/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Publish packages to Maven Central | ||
name: [RELEASE] Publish packages to Maven Central | ||
|
||
on: | ||
release: | ||
|
2 changes: 1 addition & 1 deletion
2
...hub/workflows/publish-github-packages.yml → .github/workflows/trigger-snapshots.yml
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,4 +1,4 @@ | ||
name: Publish package to GitHub Packages | ||
name: [SNAPSHOTS] Publish package to GitHub Packages | ||
|
||
on: | ||
push: | ||
|
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