Skip to content

Commit 017c4f2

Browse files
committed
Update Maven credentials, add GitHub Actions for deployment
Changed the Maven repository URL and updated the credential handling to use environment variables. Added a new GitHub Actions workflow to automate the publishing of packages to the Maven repository upon release creation.
1 parent 1da1e74 commit 017c4f2

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish package to the Maven Repository
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish:
9+
runs-on: [ self-hosted, small ]
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Set up Java
14+
uses: actions/setup-java@v4
15+
with:
16+
java-version: '21'
17+
distribution: 'temurin'
18+
19+
- name: Setup Gradle
20+
uses: gradle/actions/setup-gradle@v4
21+
22+
- name: Publish package
23+
run: ./gradlew publish
24+
env:
25+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
26+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ publishing {
2929
maven {
3030
url "https://packages.jetbrains.team/maven/p/hyperskill-hs-test/maven"
3131
credentials {
32-
username = spaceUsername
33-
password = spacePassword
32+
username = System.getenv("MAVEN_USERNAME")
33+
password = System.getenv("MAVEN_PASSWORD")
3434
}
3535
}
3636
}

0 commit comments

Comments
 (0)