Skip to content

Commit 1103f42

Browse files
committed
2 parents 273254c + 9de52db commit 1103f42

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy to Maven Central
2+
3+
on:
4+
workflow_dispatch: # Permite ejecutar manualmente desde GitHub Actions
5+
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v3
12+
13+
- name: Set up Java
14+
uses: actions/setup-java@v3
15+
with:
16+
distribution: 'temurin'
17+
java-version: '17'
18+
server-id: central
19+
server-username: MAVEN_USERNAME
20+
server-password: MAVEN_PASSWORD
21+
22+
- name: Extract version from POM
23+
id: get_version
24+
run: echo "VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
25+
26+
- name: Import GPG Key
27+
run: |
28+
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import
29+
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
30+
gpgconf --reload gpg-agent
31+
32+
- name: Build and Publish
33+
run: mvn clean deploy -P release
34+
env:
35+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
36+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
37+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
38+
39+
- name: Create GitHub Release
40+
uses: softprops/action-gh-release@v1
41+
with:
42+
tag_name: v${{ env.VERSION }}
43+
name: Release v${{ env.VERSION }}
44+
body: "New release v${{ env.VERSION }} deployed to Maven Central."
45+
draft: false
46+
prerelease: false

0 commit comments

Comments
 (0)