|
| 1 | +name: 'Build' |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '37 04,16 * * *' |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | + |
| 9 | +defaults: |
| 10 | + run: |
| 11 | + shell: "bash" |
| 12 | + |
| 13 | +env: |
| 14 | + GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false" |
| 15 | + RUNNING_ON_CI: "true" |
| 16 | + LC_ALL: C.UTF-8 |
| 17 | + LANG: C.UTF-8 |
| 18 | + ASSEMBLE_ONLY: "true" |
| 19 | + |
| 20 | +jobs: |
| 21 | + macos: |
| 22 | + name: Build on macOS |
| 23 | + runs-on: macos-latest |
| 24 | + env: |
| 25 | + BUILD_TARGETS: ios-device-arm64,ios-simulator-arm64,ios-simulator-x64,tvos-device-arm64,tvos-simulator-arm64,tvos-simulator-x64,watchos-device-arm32,watchos-device-arm64,watchos-device-arm64_32,watchos-simulator-arm64,watchos-simulator-x64,macos-arm64,macos-x64 |
| 26 | + steps: |
| 27 | + - name: Setup Python |
| 28 | + uses: actions/setup-python@v5 |
| 29 | + with: |
| 30 | + python-version: "3.x" |
| 31 | + - name: Checkout |
| 32 | + uses: actions/checkout@v4 |
| 33 | + - name: Validate Gradle Wrapper |
| 34 | + uses: gradle/actions/wrapper-validation@v4 |
| 35 | + - name: Install JDK |
| 36 | + uses: actions/setup-java@v4 |
| 37 | + with: |
| 38 | + java-version: "17" |
| 39 | + distribution: "temurin" |
| 40 | + cache: "gradle" |
| 41 | + check-latest: true |
| 42 | + - name: Build |
| 43 | + run: ./gradlew assembleAll |
| 44 | + - name: Upload artifacts |
| 45 | + uses: actions/upload-artifact@v4 |
| 46 | + with: |
| 47 | + name: "artifacts-macos" |
| 48 | + path: "build/conan/artifacts" |
| 49 | + if-no-files-found: "ignore" |
| 50 | + - name: Bundle the build report |
| 51 | + if: failure() |
| 52 | + run: find . -type d -name 'reports' | zip -@ -r build-report.zip |
| 53 | + - name: Upload the build report |
| 54 | + if: failure() |
| 55 | + uses: actions/upload-artifact@master |
| 56 | + with: |
| 57 | + name: build-report |
| 58 | + path: build-report.zip |
| 59 | + |
| 60 | + linux: |
| 61 | + name: Build on Linux |
| 62 | + runs-on: ubuntu-latest |
| 63 | + env: |
| 64 | + BUILD_TARGETS: android-arm64,android-arm32,android-x64,android-x86,wasm |
| 65 | + steps: |
| 66 | + - name: Setup Python |
| 67 | + uses: actions/setup-python@v5 |
| 68 | + with: |
| 69 | + python-version: "3.x" |
| 70 | + - name: Checkout |
| 71 | + uses: actions/checkout@v4 |
| 72 | + - name: Validate Gradle Wrapper |
| 73 | + uses: gradle/actions/wrapper-validation@v4 |
| 74 | + - name: Install JDK |
| 75 | + uses: actions/setup-java@v4 |
| 76 | + with: |
| 77 | + java-version: "17" |
| 78 | + distribution: "temurin" |
| 79 | + cache: "gradle" |
| 80 | + check-latest: true |
| 81 | + - name: Build |
| 82 | + run: ./gradlew assembleAll |
| 83 | + - name: Upload artifacts |
| 84 | + uses: actions/upload-artifact@v4 |
| 85 | + with: |
| 86 | + name: "artifacts-linux" |
| 87 | + path: "build/conan/artifacts" |
| 88 | + if-no-files-found: "ignore" |
| 89 | + - name: Bundle the build report |
| 90 | + if: failure() |
| 91 | + run: find . -type d -name 'reports' | zip -@ -r build-report.zip |
| 92 | + - name: Upload the build report |
| 93 | + if: failure() |
| 94 | + uses: actions/upload-artifact@master |
| 95 | + with: |
| 96 | + name: build-report |
| 97 | + path: build-report.zip |
| 98 | + |
| 99 | + linux2: |
| 100 | + name: Build on Linux 2 |
| 101 | + runs-on: ubuntu-latest |
| 102 | + env: |
| 103 | + BUILD_TARGETS: linux-x64,linux-arm64 |
| 104 | + container: |
| 105 | + image: ubuntu:20.04 |
| 106 | + steps: |
| 107 | + - name: apt install |
| 108 | + run: apt update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install python3-venv g++-8-aarch64-linux-gnu g++-8 git cmake -y |
| 109 | + - name: Checkout |
| 110 | + uses: actions/checkout@v4 |
| 111 | + - name: Validate Gradle Wrapper |
| 112 | + uses: gradle/actions/wrapper-validation@v4 |
| 113 | + - name: Install JDK |
| 114 | + uses: actions/setup-java@v4 |
| 115 | + with: |
| 116 | + java-version: "17" |
| 117 | + distribution: "temurin" |
| 118 | + cache: "gradle" |
| 119 | + check-latest: true |
| 120 | + - name: Build |
| 121 | + run: ./gradlew assembleAll |
| 122 | + - name: Upload artifacts |
| 123 | + uses: actions/upload-artifact@v4 |
| 124 | + with: |
| 125 | + name: "artifacts-linux-container" |
| 126 | + path: "build/conan/artifacts" |
| 127 | + if-no-files-found: "ignore" |
| 128 | + - name: Bundle the build report |
| 129 | + if: failure() |
| 130 | + run: find . -type d -name 'reports' | zip -@ -r build-report.zip |
| 131 | + - name: Upload the build report |
| 132 | + if: failure() |
| 133 | + uses: actions/upload-artifact@master |
| 134 | + with: |
| 135 | + name: build-report |
| 136 | + path: build-report.zip |
| 137 | + |
| 138 | + windows: |
| 139 | + name: Build on Windows |
| 140 | + runs-on: windows-latest |
| 141 | + env: |
| 142 | + BUILD_TARGETS: mingw-x64,windows-x64 |
| 143 | + steps: |
| 144 | + - name: Setup Python |
| 145 | + uses: actions/setup-python@v5 |
| 146 | + with: |
| 147 | + python-version: "3.x" |
| 148 | + - name: Checkout |
| 149 | + uses: actions/checkout@v4 |
| 150 | + - name: Validate Gradle Wrapper |
| 151 | + uses: gradle/actions/wrapper-validation@v4 |
| 152 | + - name: Install JDK |
| 153 | + uses: actions/setup-java@v4 |
| 154 | + with: |
| 155 | + java-version: "17" |
| 156 | + distribution: "temurin" |
| 157 | + cache: "gradle" |
| 158 | + check-latest: true |
| 159 | + - name: Build |
| 160 | + run: ./gradlew assembleAll |
| 161 | + - name: Upload artifacts |
| 162 | + uses: actions/upload-artifact@v4 |
| 163 | + with: |
| 164 | + name: "artifacts-windows" |
| 165 | + path: "build/conan/artifacts" |
| 166 | + if-no-files-found: "ignore" |
| 167 | + - name: Bundle the build report |
| 168 | + if: failure() |
| 169 | + run: find . -type d -name 'reports' | zip -@ -r build-report.zip |
| 170 | + - name: Upload the build report |
| 171 | + if: failure() |
| 172 | + uses: actions/upload-artifact@master |
| 173 | + with: |
| 174 | + name: build-report |
| 175 | + path: build-report.zip |
| 176 | + |
| 177 | + aggregate: |
| 178 | + runs-on: ubuntu-latest |
| 179 | + needs: |
| 180 | + - macos |
| 181 | + - linux |
| 182 | + - linux2 |
| 183 | + - windows |
| 184 | + env: |
| 185 | + ASSEMBLE_ONLY: "false" |
| 186 | + steps: |
| 187 | + - name: Setup Python |
| 188 | + uses: actions/setup-python@v5 |
| 189 | + with: |
| 190 | + python-version: "3.x" |
| 191 | + - name: Checkout |
| 192 | + uses: actions/checkout@v4 |
| 193 | + - name: Validate Gradle Wrapper |
| 194 | + uses: gradle/actions/wrapper-validation@v4 |
| 195 | + - name: Install JDK |
| 196 | + uses: actions/setup-java@v4 |
| 197 | + with: |
| 198 | + java-version: "17" |
| 199 | + distribution: "temurin" |
| 200 | + cache: "gradle" |
| 201 | + check-latest: true |
| 202 | + - name: Download all build artifacts |
| 203 | + uses: actions/download-artifact@v4 |
| 204 | + with: |
| 205 | + pattern: "artifacts-*" |
| 206 | + path: "build/conan/artifacts" |
| 207 | + merge-multiple: true |
| 208 | + - name: Publish package |
| 209 | + run: ./gradlew publishToMavenCentral |
| 210 | + env: |
| 211 | + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.PUBLICATION_USERNAME }} |
| 212 | + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.PUBLICATION_PASSWORD }} |
| 213 | + ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} |
| 214 | + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY_RING }} |
| 215 | + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} |
| 216 | + |
| 217 | + - name: Bundle the build report |
| 218 | + if: failure() |
| 219 | + run: find . -type d -name 'reports' | zip -@ -r build-report.zip |
| 220 | + - name: Upload the build report |
| 221 | + if: failure() |
| 222 | + uses: actions/upload-artifact@master |
| 223 | + with: |
| 224 | + name: build-report |
| 225 | + path: build-report.zip |
0 commit comments