-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 2.73 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Publish app module
on:
push:
branches:
- main
paths:
- 'firebase-app/**'
- 'firebase-auth/**'
- 'firebase-firestore/**'
- 'firebase-storage/**'
- 'firebase-util/**'
- 'firebase-wrapper-bom/**'
jobs:
publish:
runs-on: ubuntu-latest
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyId }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyPassword }}
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache gradle
uses: actions/cache@v3
with:
path: build/js
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Set up java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '21'
cache: 'gradle'
- name: Set up gradle
uses: gradle/gradle-build-action@v2
- name: Grant execution permission
run: chmod +x ./gradlew
- name: Search changed files
id: changed-files
uses: tj-actions/[email protected]
- name: Publish app module
if: contains(steps.changed-files.outputs.all_modified_files, 'firebase-app/build.gradle.kts')
run: ./gradlew :firebase-app:publishToMavenCentral
- name: Publish auth module
if: contains(steps.changed-files.outputs.all_modified_files, 'firebase-auth/build.gradle.kts')
run: ./gradlew :firebase-auth:publishToMavenCentral
- name: Publish firestore module
if: contains(steps.changed-files.outputs.all_modified_files, 'firebase-firestore/build.gradle.kts')
run: ./gradlew :firebase-firestore:publishToMavenCentral
- name: Publish storage module
if: contains(steps.changed-files.outputs.all_modified_files, 'firebase-storage/build.gradle.kts')
run: ./gradlew :firebase-storage:publishToMavenCentral
- name: Publish util module
if: contains(steps.changed-files.outputs.all_modified_files, 'firebase-util/build.gradle.kts')
run: ./gradlew :firebase-util:publishToMavenCentral
- name: Publish bom module
if: contains(steps.changed-files.outputs.all_modified_files, 'firebase-wrapper-bom/build.gradle.kts')
run: ./gradlew :firebase-wrapper-bom:publishToMavenCentral