Add enabled to SettingsGroup & Fix padding in Sample (#267) #161
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: Main | |
on: | |
push: | |
branches: | |
- main | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
detekt: | |
name: Detekt - Main | |
runs-on: macos-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Detekt - Main | |
run: ./gradlew detektAll | |
build-lib-base: | |
strategy: | |
matrix: | |
config: [ | |
{ target: storage, module: storage-base, task: build, continueOnError: false }, | |
{ target: ui, module: ui-base, task: build, continueOnError: false }, | |
] | |
name: Build ${{ matrix.config.target }} - Main | |
if: ${{ success() }} | |
needs: [ detekt ] | |
runs-on: macos-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Build | |
continue-on-error: ${{ matrix.config.continueOnError }} | |
run: ./gradlew :${{ matrix.config.module }}:${{ matrix.config.task }} | |
build-lib-storage: | |
strategy: | |
matrix: | |
config: [ | |
{ target: memory, module: storage-memory, task: build, continueOnError: false }, | |
{ target: disk, module: storage-disk, task: build, continueOnError: false }, | |
] | |
name: Build ${{ matrix.config.target }} - Main | |
if: ${{ success() }} | |
needs: [ detekt, build-lib-base ] | |
runs-on: macos-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Build | |
continue-on-error: ${{ matrix.config.continueOnError }} | |
run: ./gradlew :${{ matrix.config.module }}:${{ matrix.config.task }} | |
build-lib-ui: | |
strategy: | |
matrix: | |
config: [ | |
{ target: tiles, module: ui-tiles, task: build, continueOnError: false }, | |
{ target: tiles expanded, module: ui-tiles-extended, task: build, continueOnError: false }, | |
] | |
name: Build ${{ matrix.config.target }} - Main | |
if: ${{ success() }} | |
needs: [ detekt, build-lib-base ] | |
runs-on: macos-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Build | |
continue-on-error: ${{ matrix.config.continueOnError }} | |
run: ./gradlew :${{ matrix.config.module }}:${{ matrix.config.task }} | |
build-sample: | |
strategy: | |
matrix: | |
config: [ | |
{ target: android, os: ubuntu-latest, tasks: assembleDebug, continueOnError: false }, | |
{ target: iOS, os: macos-latest, tasks: compileKotlinIosArm64 compileKotlinIosX64 compileKotlinIosSimulatorArm64, continueOnError: false }, | |
{ target: js, os: ubuntu-latest, tasks: jsBrowserDistribution, continueOnError: false }, | |
{ target: desktop, os: ubuntu-latest, tasks: compileKotlinDesktop, continueOnError: false } | |
] | |
if: ${{ success() }} | |
needs: [ build-lib-ui, build-lib-storage ] | |
runs-on: ${{ matrix.config.os }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Build sample ${{ matrix.config.target }} - Main | |
continue-on-error: ${{ matrix.config.continueOnError }} | |
run: ./gradlew :composeApp:${{ matrix.config.tasks }} | |
verify-screenshots: | |
name: Validate screenshots - PR | |
if: ${{ success() }} | |
needs: [ build-sample ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Validate screenshots - PR | |
run: ./gradlew validateScreenshotTest | |
check-sign: | |
name: Check signature - Main | |
if: ${{ success() }} | |
needs: [ build-sample ] | |
runs-on: macos-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Check signature - Main | |
run: ./gradlew signReleasePublication -Psigning.secretKeyRingFile=../secrets.gpg -Psigning.keyId=${{ secrets.GPG_KEY_NAME }} -Psigning.password=${{ secrets.GPG_PASSPHRASE }} | |
fake-publish: | |
name: Fake publish - Main | |
if: ${{ success() }} | |
needs: [ build-sample ] | |
runs-on: macos-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Publish to MavenLocal | |
run: ./gradlew publishToMavenLocal -Psigning.secretKeyRingFile=../secrets.gpg -Psigning.keyId=${{ secrets.GPG_KEY_NAME }} -Psigning.password=${{ secrets.GPG_PASSPHRASE }} | |
publish-dry: | |
name: Dry run publish - Main | |
if: ${{ success() }} | |
needs: [ check-sign, build-sample ] | |
runs-on: macos-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Publish to MavenCentral (dry) | |
run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache --max-workers 1 -Psigning.secretKeyRingFile=../secrets.gpg -Psigning.keyId=${{ secrets.GPG_KEY_NAME }} -Psigning.password=${{ secrets.GPG_PASSPHRASE }} -PmavenCentralUsername=${{ secrets.OSSRH_USERNAME }} -PmavenCentralPassword=${{ secrets.OSSRH_PASSWORD }} --dry-run | |
# Deployment job | |
deploy: | |
name: Deploy to Github pages | |
if: ${{ success() }} | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: [ build-sample ] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Build sample JS - Main | |
run: ./gradlew jsBrowserDistribution | |
- name: Upload your page as github pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: composeApp/build/dist/js/productionExecutable/ | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |