Compare commits

...
2 Commits
Author SHA1 Message Date
Jonathan 小林 Hales 440920f07c v0.1.0-alpha.4 2020-11-17 17:25:08 -08:00
Jonathan 小林 Hales 5a21a3e75b [eas-cli] add command release:create
This reverts commit ed798057a3.
2020-11-17 17:21:18 -08:00
6 changed files with 121 additions and 46 deletions

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.1.0-alpha.3"
"version": "0.1.0-alpha.4"
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@eas/config",
"description": "A library for interacting with the eas.json",
"version": "0.1.0-alpha.2",
"version": "0.1.0-alpha.4",
"author": "Expo <[email protected]>",
"bugs": "https://github.com/expo/eas-cli/issues",
"dependencies": {
+16 -30
View File
@@ -21,7 +21,7 @@ $ npm install -g eas-cli
$ eas COMMAND
running command...
$ eas (-v|--version|version)
eas-cli/0.1.0-alpha.3 darwin-x64 node-v12.13.0
eas-cli/0.1.0-alpha.4 darwin-x64 node-v12.16.2
$ eas --help [COMMAND]
USAGE
$ eas COMMAND
@@ -43,7 +43,8 @@ USAGE
* [`eas credentials`](#eas-credentials)
* [`eas device:create`](#eas-devicecreate)
* [`eas help [COMMAND]`](#eas-help-command)
* [`eas update`](#eas-update)
* [`eas release:create [RELEASENAME]`](#eas-releasecreate-releasename)
* [`eas release:publish`](#eas-releasepublish)
* [`eas update:show`](#eas-updateshow)
## `eas account:login`
@@ -58,8 +59,6 @@ ALIASES
$ eas login
```
_See code: [build/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v0.1.0-alpha.3/build/commands/account/login.ts)_
## `eas account:logout`
log out
@@ -72,8 +71,6 @@ ALIASES
$ eas logout
```
_See code: [build/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v0.1.0-alpha.3/build/commands/account/logout.ts)_
## `eas account:view`
show the username you are logged in as
@@ -86,8 +83,6 @@ ALIASES
$ eas whoami
```
_See code: [build/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v0.1.0-alpha.3/build/commands/account/view.ts)_
## `eas build`
build an app binary for your project
@@ -97,8 +92,6 @@ USAGE
$ eas build
```
_See code: [build/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v0.1.0-alpha.3/build/commands/build/index.ts)_
## `eas build:configure`
Configure the project to support EAS Build.
@@ -111,8 +104,6 @@ OPTIONS
-p, --platform=(android|ios|all) [default: all] Platform to configure
```
_See code: [build/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v0.1.0-alpha.3/build/commands/build/configure.ts)_
## `eas build:create`
Start a build
@@ -130,8 +121,6 @@ OPTIONS
--wait Wait for build(s) to complete
```
_See code: [build/commands/build/create.ts](https://github.com/expo/eas-cli/blob/v0.1.0-alpha.3/build/commands/build/create.ts)_
## `eas build:status`
get the status of the latest builds for your project
@@ -145,8 +134,6 @@ OPTIONS
--status=(in-queue|in-progress|errored|finished)
```
_See code: [build/commands/build/status.ts](https://github.com/expo/eas-cli/blob/v0.1.0-alpha.3/build/commands/build/status.ts)_
## `eas build:submit`
Submits build artifact to app store
@@ -191,8 +178,6 @@ OPTIONS
--verbose Always print logs from Submission Service
```
_See code: [build/commands/build/submit.ts](https://github.com/expo/eas-cli/blob/v0.1.0-alpha.3/build/commands/build/submit.ts)_
## `eas credentials`
Manage your credentials
@@ -202,8 +187,6 @@ USAGE
$ eas credentials
```
_See code: [build/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v0.1.0-alpha.3/build/commands/credentials.ts)_
## `eas device:create`
register new Apple Devices to use for internal distribution
@@ -213,8 +196,6 @@ USAGE
$ eas device:create
```
_See code: [build/commands/device/create.ts](https://github.com/expo/eas-cli/blob/v0.1.0-alpha.3/build/commands/device/create.ts)_
## `eas help [COMMAND]`
display help for eas
@@ -232,19 +213,26 @@ OPTIONS
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.0/src/commands/help.ts)_
## `eas update`
## `eas release:create [RELEASENAME]`
create a revision for given channel
Create a release on the current project.
```
USAGE
$ eas update
$ eas release:create [RELEASENAME]
ALIASES
$ eas update:publish
ARGUMENTS
RELEASENAME Name of the release to create
```
_See code: [build/commands/update/index.ts](https://github.com/expo/eas-cli/blob/v0.1.0-alpha.3/build/commands/update/index.ts)_
## `eas release:publish`
Publish an updateGroup on a release.
```
USAGE
$ eas release:publish
```
## `eas update:show`
@@ -254,6 +242,4 @@ details about a particular revision
USAGE
$ eas update:show
```
_See code: [build/commands/update/show.ts](https://github.com/expo/eas-cli/blob/v0.1.0-alpha.3/build/commands/update/show.ts)_
<!-- commandsstop -->
+6 -3
View File
@@ -1,14 +1,14 @@
{
"name": "eas-cli",
"description": "EAS command line tool",
"version": "0.1.0-alpha.3",
"version": "0.1.0-alpha.4",
"author": "Expo <[email protected]>",
"bin": {
"eas": "./bin/run"
},
"bugs": "https://github.com/expo/eas-cli/issues",
"dependencies": {
"@eas/config": "^0.1.0-alpha.2",
"@eas/config": "^0.1.0-alpha.4",
"@expo/config": "^3.3.12",
"@expo/eas-build-job": "0.1.1",
"@expo/json-file": "^8.2.24",
@@ -102,8 +102,11 @@
"build": {
"description": "build app binaries"
},
"release": {
"description": "manage update releases"
},
"update": {
"description": "roll out changes"
"description": "manage individual updates"
},
"webhook": {
"description": "manage webhooks"
@@ -0,0 +1,97 @@
import { Command, flags } from '@oclif/command';
import chalk from 'chalk';
import gql from 'graphql-tag';
import { graphqlClient, withErrorHandlingAsync } from '../../graphql/client';
import log from '../../log';
import { findProjectRootAsync } from '../../project/projectUtils';
import { promptAsync } from '../../prompts';
import { getProjectIdAsync } from '../../submissions/commons';
type UpdateRelease = {
id: string;
releaseName: string;
};
async function createUpdateReleaseOnAppAsync({
appId,
releaseName,
}: {
appId: string;
releaseName: string;
}): Promise<UpdateRelease> {
const data = await withErrorHandlingAsync(
graphqlClient
.mutation<
{ updateRelease: { createUpdateReleaseForApp: UpdateRelease } },
{ appId: string; releaseName: string }
>(
gql`
mutation CreateUpdateReleaseForApp($appId: ID!, $releaseName: String!) {
updateRelease {
createUpdateReleaseForApp(appId: $appId, releaseName: $releaseName) {
id
releaseName
}
}
}
`,
{
appId,
releaseName,
}
)
.toPromise()
);
return data.updateRelease.createUpdateReleaseForApp;
}
export default class ReleaseCreate extends Command {
static description = 'Create a release on the current project.';
static args = [
{
name: 'releaseName',
required: false,
description: 'Name of the release to create',
},
];
async run() {
let {
args: { releaseName },
} = this.parse(ReleaseCreate);
const projectDir = await findProjectRootAsync(process.cwd());
if (!projectDir) {
log.error("Please run this command inside your project's directory.");
return;
}
const projectId = await getProjectIdAsync(projectDir);
if (!releaseName) {
const userInput = await promptAsync({
type: 'text',
name: 'releaseName',
message: 'Please name the release:',
});
releaseName = userInput.releaseName;
}
if (!releaseName) {
log.error('You must specify a releaseName.');
return;
}
try {
const res = await createUpdateReleaseOnAppAsync({ appId: projectId, releaseName });
log.withTick(
`️Created a new release: ${chalk.bold(res.releaseName)} on project with id ${chalk.bold(
projectId
)}.`
);
} catch (e) {
log.error(e);
}
}
}
@@ -1,11 +0,0 @@
import { Command } from '@oclif/command';
export default class UpdateIndex extends Command {
static description = 'create a revision for given channel';
static aliases = ['update:publish'];
async run() {
throw new Error('Not implemented');
}
}