name: Daily on: schedule: - cron: 00 10 * * * workflow_dispatch: jobs: check-last-run: runs-on: ubuntu-latest steps: - uses: octokit/request-action@v2.x id: check-last-run with: route: | GET /repos/${{github.repository}}/actions/workflows/daily.yml/runs?per_page=1&status=completed env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} outputs: last_sha: | ${{ fromJson(steps.check-last-run.outputs.data).workflow_runs[0].head_sha }} build-natives: needs: [check-last-run] if: ${{ needs.check-last-run.outputs.last_sha != github.sha }} strategy: fail-fast: true matrix: include: - variant: macos-aarch64-metal renderer: metal preset: macos-metal runner: macos-latest # aarch64 - variant: linux-amd64-opengl renderer: opengl preset: linux-opengl runner: ubuntu-latest # amd64 - variant: windows-amd64-opengl renderer: opengl preset: windows-opengl runner: windows-latest # amd64 runs-on: ${{ matrix.runner }} name: build-natives (${{ matrix.variant }}) steps: - if: ${{ matrix.runner == 'windows-latest' }} run: git config --global core.longpaths true - uses: actions/checkout@v5 with: fetch-depth: 0 submodules: recursive - uses: ./.github/actions/setup-cmake - uses: ./.github/actions/setup-gradle - run: | ./gradlew :lib:maplibre-native-bindings-jni:buildNative -PdesktopRenderer=${{ matrix.renderer }} - uses: actions/upload-artifact@v5 with: if-no-files-found: error name: natives-${{ matrix.variant }} path: | ./lib/maplibre-native-bindings-jni/build/lib/${{ matrix.preset }}/shared/* publish-snapshot: needs: [check-last-run, build-natives] if: ${{ needs.check-last-run.outputs.last_sha != github.sha }} runs-on: macos-latest permissions: packages: write steps: - uses: actions/checkout@v5 with: fetch-depth: 0 - uses: ./.github/actions/setup-gradle - uses: actions/download-artifact@v6 with: name: natives-macos-aarch64-metal path: ./lib/maplibre-native-bindings-jni/build/copiedResources/MacosAarch64Metal/macos/aarch64/metal/ - uses: actions/download-artifact@v6 with: name: natives-linux-amd64-opengl path: ./lib/maplibre-native-bindings-jni/build/copiedResources/LinuxAmd64Opengl/linux/amd64/opengl/ - uses: actions/download-artifact@v6 with: name: natives-windows-amd64-opengl path: ./lib/maplibre-native-bindings-jni/build/copiedResources/WindowsAmd64Opengl/windows/amd64/opengl/ - run: | ./gradlew publishAllPublicationsToGitHubPackagesRepository -PconfigureForPublishing=true env: ORG_GRADLE_PROJECT_githubToken: ${{ secrets.GITHUB_TOKEN }} ORG_GRADLE_PROJECT_githubUser: ${{ github.actor }} dependency-submission: needs: [check-last-run] if: ${{ needs.check-last-run.outputs.last_sha != github.sha }} runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 with: distribution: temurin java-version: 21 - uses: gradle/actions/dependency-submission@v5 with: build-scan-publish: true build-scan-terms-of-use-url: https://gradle.com/help/legal-terms-of-use build-scan-terms-of-use-agree: yes