forked from TencentBlueKing/bk-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (39 loc) · 1.55 KB
/
publishMavenJar4CI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: deploy CI jar to OSS
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-gradle
- name: Gradle Build
working-directory: src/backend
env:
MAVEN_REPO_DEPLOY_URL: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
run: |
echo "GITHUB_REF=${GITHUB_REF}"
repo_version=${GITHUB_REF##*/v}
echo "repo_version=${repo_version}"
./gradlew publishAllPublicationsToAllJarRepository -Drepo_version=${repo_version} \
-PallJarRepo=${MAVEN_REPO_DEPLOY_URL} \
-PallJarUsername=${SONATYPE_USERNAME} \
-PallJarPassword=${SONATYPE_PASSWORD}