test: 自動パブリッシュのテスト #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish app module | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'firebase-app/**' | |
- 'firebase-auth/**' | |
- 'firebase-firestore/**' | |
- 'firebase-storage/**' | |
- '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 bom module | |
if: contains(steps.changed-files.outputs.all_modified_files, 'firebase-wrapper-bom/build.gradle.kts') | |
run: ./gradlew :firebase-wrapper-bom:publishToMavenCentral |