Nightly #841
This file contains hidden or 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: Nightly | |
| on: | |
| workflow_dispatch: | |
| # nightly build @ 2:15 AM UTC | |
| schedule: | |
| - cron: "15 2 * * *" | |
| permissions: | |
| contents: read | |
| jobs: | |
| set_release_type: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'facebook/react-native' | |
| outputs: | |
| RELEASE_TYPE: ${{ steps.set_release_type.outputs.RELEASE_TYPE }} | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| REF: ${{ github.ref }} | |
| steps: | |
| - id: set_release_type | |
| run: | | |
| echo "Setting release type to nightly" | |
| echo "RELEASE_TYPE=nightly" >> $GITHUB_OUTPUT | |
| prebuild_apple_dependencies: | |
| if: github.repository == 'facebook/react-native' | |
| uses: ./.github/workflows/prebuild-ios-dependencies.yml | |
| secrets: inherit | |
| prebuild_react_native_core: | |
| uses: ./.github/workflows/prebuild-ios-core.yml | |
| with: | |
| use-hermes-prebuilt: true | |
| version-type: nightly | |
| secrets: inherit | |
| needs: [prebuild_apple_dependencies] | |
| build_android: | |
| runs-on: 8-core-ubuntu | |
| if: github.repository == 'facebook/react-native' | |
| needs: [set_release_type] | |
| container: | |
| image: reactnativecommunity/react-native-android:latest | |
| env: | |
| TERM: "dumb" | |
| # Set the encoding to resolve a known character encoding issue with decompressing tar.gz files in containers | |
| # via Gradle: https://github.com/gradle/gradle/issues/23391#issuecomment-1878979127 | |
| LC_ALL: C.UTF8 | |
| GRADLE_OPTS: "-Dorg.gradle.daemon=false" | |
| ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }} | |
| ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }} | |
| ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }} | |
| ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }} | |
| REACT_NATIVE_DOWNLOADS_DIR: /opt/react-native-downloads | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Build Android | |
| uses: ./.github/actions/build-android | |
| with: | |
| release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }} | |
| gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} | |
| # Delegate the actual npm publish to the shared reusable workflow so | |
| # every `npm publish` in this repo originates from one workflow file — | |
| # required because npm Trusted Publishing only accepts one | |
| # (org, repo, workflow_filename) per package. | |
| build_npm_package: | |
| needs: | |
| [ | |
| set_release_type, | |
| build_android, | |
| prebuild_apple_dependencies, | |
| prebuild_react_native_core, | |
| ] | |
| # The top-level `permissions: contents: read` is the ceiling for | |
| # GITHUB_TOKEN in every job here, including reusable-workflow calls. | |
| # Re-grant `id-token: write` at the job level so publish-npm.yml's | |
| # `publish-react-native` job can mint the OIDC token that npm | |
| # Trusted Publishing exchanges for a publish token. | |
| permissions: | |
| contents: read | |
| id-token: write | |
| uses: ./.github/workflows/publish-npm.yml | |
| secrets: inherit | |
| with: | |
| mode: react-native | |
| release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }} |