Skip to content

Commit b65a5f4

Browse files
committed
Fix publish
1 parent 9bb716e commit b65a5f4

3 files changed

Lines changed: 68 additions & 4 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build for Release
2+
3+
on: workflow_dispatch
4+
permissions:
5+
contents: write
6+
7+
env:
8+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
9+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
10+
11+
jobs:
12+
build-for-release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
ref: master
19+
- name: Setup git config
20+
run: |
21+
git config user.name github-actions
22+
git config user.email github-actions@github.com
23+
24+
- name: Set up JDK 19
25+
uses: actions/setup-java@v4
26+
with:
27+
java-version: '19'
28+
distribution: 'corretto'
29+
cache: maven
30+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
31+
server-id: central # Value of the distributionManagement/repository/id field of the pom.xml
32+
server-username: MAVEN_USERNAME # env variable for username in deploy
33+
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
34+
- name: View settings.xml
35+
run: cat /home/runner/.m2/settings.xml
36+
- name: Prepare for release
37+
run: mvn -B release:prepare release:perform --file pom.xml
38+
39+
- name: Update dependency graph
40+
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Deploy to central
2+
3+
on: workflow_dispatch
4+
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set env
15+
run: echo "RELEASE_VERSION=v0.0.2" >> $GITHUB_ENV
16+
- name: Set up JDK 19
17+
uses: actions/setup-java@v4
18+
with:
19+
java-version: '19'
20+
distribution: 'corretto'
21+
server-id: central # Value of the distributionManagement/repository/id field of the pom.xml
22+
server-username: ${{ secrets.MAVEN_USERNAME }} # env variable for username in deploy
23+
server-password: ${{ secrets.MAVEN_CENTRAL_TOKEN }} # env variable for token in deploy
24+
25+
- name: Release with Maven
26+
run: mvn -B release:perform -DconnectionUrl=scm:git:${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ env.RELEASE_VERSION }}

pom.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@
2929
<developer>
3030
<name>Abdulkadir Elmaci</name>
3131
<email>abdulkadirelmaci@gmail.com</email>
32-
<organization>Sonatype</organization>
33-
<organizationUrl>http://www.sonatype.com</organizationUrl>
32+
<organizationUrl>https://github.com/CodeBlo</organizationUrl>
3433
</developer>
3534
</developers>
3635

3736
<scm>
38-
<connection>scm:git:git://github.com/CodeBlo/rollbacker.git</connection>
39-
<developerConnection>scm:git:ssh://github.com:CodeBlo/rollbacker.git</developerConnection>
37+
<connection>scm:git:https://github.com/CodeBlo/rollbacker.git</connection>
4038
<url>https://github.com/CodeBlo/rollbacker/tree/master</url>
4139
</scm>
4240

0 commit comments

Comments
 (0)