Skip to content

Commit bc04ef9

Browse files
authored
Create deploy.yml
1 parent d67b0bc commit bc04ef9

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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: Build and Publish
27+
run: mvn clean deploy -P release
28+
env:
29+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
30+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
31+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
32+
33+
- name: Create GitHub Release
34+
uses: softprops/action-gh-release@v1
35+
with:
36+
tag_name: v${{ env.VERSION }}
37+
name: Release v${{ env.VERSION }}
38+
body: "New release v${{ env.VERSION }} deployed to Maven Central."
39+
draft: false
40+
prerelease: false

0 commit comments

Comments
 (0)