-
Notifications
You must be signed in to change notification settings - Fork 4
37 lines (31 loc) · 1.01 KB
/
publish.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
name: Publish Gradle Portal
on:
release:
types: [ published ]
jobs:
publish:
if: ${{ !startsWith(github.event.release.name, 'Saas') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
# Gradle 缓存配置
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
# 给 gradlew 文件授权
# 构建项目
- name: Build with Gradle
run: |
chmod +x gradlew
./gradlew clean
./gradlew build
- name: Publish plugin to gradlePortal
run: ./gradlew :autotracker-gradle-plugin:publishPlugins -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}