-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Distribute React Native DevTools binaries via GitHub Releases #52930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
b5cb475
72ef1f0
e090b2a
afe025d
3d13133
dc05171
359411e
5429325
1c2fbb8
843f561
5b02181
df892eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,9 +21,24 @@ jobs: | |||||
| git config --local user.name "React Native Bot" | ||||||
| - name: Create draft release | ||||||
| uses: actions/github-script@v6 | ||||||
| id: create-draft-release | ||||||
| with: | ||||||
| script: | | ||||||
| const {createDraftRelease} = require('./.github/workflow-scripts/createDraftRelease.js'); | ||||||
| const version = '${{ github.ref_name }}'; | ||||||
| const {isLatest} = require('./.github/workflow-scripts/publishTemplate.js'); | ||||||
| await createDraftRelease(version, isLatest(), '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}'); | ||||||
| return (await createDraftRelease(version, isLatest(), '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}')).id; | ||||||
| result-encoding: string | ||||||
| - name: Upload release assets for DotSlash | ||||||
| uses: actions/github-script@v6 | ||||||
| env: | ||||||
| RELEASE_ID: ${{ steps.create-draft-release.outputs.result }} | ||||||
| with: | ||||||
| script: | | ||||||
| const {uploadReleaseAssetsForDotSlashFiles} = require('./scripts/releases/upload-release-assets-for-dotslash.js'); | ||||||
| const version = '${{ github.ref_name }}'; | ||||||
| await uploadReleaseAssetsForDotSlashFiles({ | ||||||
| version, | ||||||
| token: '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}', | ||||||
| releaseId: process.env.RELEASE_ID, | ||||||
|
||||||
| releaseId: process.env.RELEASE_ID, | |
| releaseId: ${{ steps.create-draft-release.outputs.result }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: Validate DotSlash Artifacts | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| release: | ||
| types: [published] | ||
| push: | ||
| branches: | ||
| - main | ||
|
||
| paths: | ||
| - packages/debugger-shell/bin/react-native-devtools | ||
| - "scripts/releases/**" | ||
| - package.json | ||
| - yarn.lock | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - packages/debugger-shell/bin/react-native-devtools | ||
| - "scripts/releases/**" | ||
| - package.json | ||
| - yarn.lock | ||
| # Same time as the nightly build: 2:15 AM UTC | ||
| schedule: | ||
| - cron: "15 2 * * *" | ||
|
|
||
| jobs: | ||
| validate-dotslash-artifacts: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| fetch-tags: true | ||
| - name: Install dependencies | ||
| uses: ./.github/actions/yarn-install | ||
| - name: Configure Git | ||
| shell: bash | ||
| run: | | ||
| git config --local user.email "bot@reactnative.dev" | ||
| git config --local user.name "React Native Bot" | ||
| - name: Validate DotSlash artifacts | ||
| uses: actions/github-script@v6 | ||
| with: | ||
| script: | | ||
| const {validateDotSlashArtifacts} = require('./scripts/releases/validate-dotslash-artifacts.js'); | ||
| await validateDotSlashArtifacts(); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @flow strict-local | ||
| * @format | ||
| */ | ||
|
|
||
| declare module '@expo/spawn-async' { | ||
| type SpawnOptions = { | ||
| cwd?: string, | ||
| env?: Object, | ||
| argv0?: string, | ||
| stdio?: string | Array<any>, | ||
| detached?: boolean, | ||
| uid?: number, | ||
| gid?: number, | ||
| shell?: boolean | string, | ||
| windowsVerbatimArguments?: boolean, | ||
| windowsHide?: boolean, | ||
| encoding?: string, | ||
| ignoreStdio?: boolean, | ||
| }; | ||
|
|
||
| declare class SpawnPromise<T> extends Promise<T> { | ||
| child: child_process$ChildProcess; | ||
| } | ||
| type SpawnResult = { | ||
| pid?: number, | ||
| output: string[], | ||
| stdout: string, | ||
| stderr: string, | ||
| status: number | null, | ||
| signal: string | null, | ||
| }; | ||
|
|
||
| declare function spawnAsync( | ||
| command: string, | ||
| args?: $ReadOnlyArray<string>, | ||
| options?: SpawnOptions, | ||
| ): SpawnPromise<SpawnResult>; | ||
|
|
||
| declare module.exports: typeof spawnAsync; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @flow strict-local | ||
| * @format | ||
| */ | ||
|
|
||
| // Partial types for Octokit based on the usage in react-native-github | ||
| declare module '@octokit/rest' { | ||
| declare class Octokit { | ||
| constructor(options?: {auth?: string, ...}): this; | ||
|
|
||
| repos: $ReadOnly<{ | ||
| listReleaseAssets: ( | ||
| params: $ReadOnly<{ | ||
| owner: string, | ||
| repo: string, | ||
| release_id: string, | ||
| }>, | ||
| ) => Promise<{ | ||
| data: Array<{ | ||
| id: string, | ||
| name: string, | ||
| ... | ||
| }>, | ||
| ... | ||
| }>, | ||
| uploadReleaseAsset: ( | ||
| params: $ReadOnly<{ | ||
| owner: string, | ||
| repo: string, | ||
| release_id: string, | ||
| name: string, | ||
| data: Buffer, | ||
| headers: $ReadOnly<{ | ||
| 'content-type': string, | ||
| ... | ||
| }>, | ||
| ... | ||
| }>, | ||
| ) => Promise<{ | ||
| data: { | ||
| browser_download_url: string, | ||
| ... | ||
| }, | ||
| ... | ||
| }>, | ||
| deleteReleaseAsset: (params: { | ||
| owner: string, | ||
| repo: string, | ||
| asset_id: string, | ||
| ... | ||
| }) => Promise<mixed>, | ||
| }>; | ||
| } | ||
|
|
||
| declare export {Octokit}; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @flow strict-local | ||
| * @format | ||
| */ | ||
|
|
||
| declare module 'fb-dotslash' { | ||
| declare module.exports: string; | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.