Merge pull request #7 from cheonjaewoong/docs-update #78
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: ci | |
on: | |
push: | |
branches: | |
- "main" | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
validate-gradle-wrapper: | |
name: Validate Gradle Wrapper | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Validate gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
test: | |
name: Test | |
runs-on: macos-latest | |
needs: validate-gradle-wrapper | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup jdk | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "zulu" | |
java-version: '17' | |
- name: Run UI tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 29 | |
target: google_apis | |
profile: Galaxy Nexus | |
script: ./gradlew connectedDebugAndroidTest --stacktrace | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
if: ${{ startsWith(github.ref, 'refs/tags/') && (github.repository == 'cheonjaewoong/gridlayout-compose') }} | |
needs: test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup jdk | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "zulu" | |
java-version: '17' | |
- name: Publish to Maven Central | |
run: ./gradlew publish --no-daemon --no-parallel --stacktrace | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} | |
build-docs: | |
name: Build Documentation | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/main' }} | |
needs: test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install Dependencies for Building Documentation | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install mkdocs | |
python3 -m pip install mkdocs-material | |
- name: Build Documentation Site | |
run: mkdocs build | |
- name: Upload Artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: ./site | |
deploy-docs: | |
name: Deploy Documentation | |
runs-on: ubuntu-latest | |
needs: build-docs | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy Documentation Site | |
id: deployment | |
uses: actions/deploy-pages@v1 |