Skip to content

Commit

Permalink
feat: add workflow for creating release tags
Browse files Browse the repository at this point in the history
新增支持通过 GitHub Actions 创建发布标签的工作流。
同时对现有工作流进行了重命名和优化,以更好区分任务用途。
  • Loading branch information
xooooooooox committed Dec 27, 2024
1 parent 3c84524 commit 8184ebf
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 2 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/create-tags.yml
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
2 changes: 1 addition & 1 deletion .github/workflows/trigger-releases.yml
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:
Expand Down
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:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ChangeLog

## 0.6

- [x] support create release tag via actions

## 0.5

- [x] dependency management shiro and jwt version
Expand Down

0 comments on commit 8184ebf

Please sign in to comment.