Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

[expo-cli] submission service: fix passing archive type from command line #2383

Merged
merged 2 commits into from
Jul 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This is the log of notable changes to Expo CLI and related packages.
### 🐛 Bug fixes

- [xdl] Fix incorrect check of the packager port in the "setOptionsAsync" function [#2270](https://github.com/expo/expo-cli/issues/2270)
- [expo-cli] expo upload:android - Fix passing archive type from command line [#2383](https://github.com/expo/expo-cli/pull/2383)

### 📦 Packages updated

Expand Down
3 changes: 2 additions & 1 deletion packages/expo-cli/src/commands/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Command } from 'commander';

import IOSUploader, { IosPlatformOptions, LANGUAGES } from './upload/IOSUploader';
import AndroidSubmitCommand from './upload/submission-service/android/AndroidSubmitCommand';
import { AndroidSubmitCommandOptions } from './upload/submission-service/android/types';
import log from '../log';
import { SubmissionMode } from './upload/submission-service/types';

Expand Down Expand Up @@ -42,7 +43,7 @@ export default function (program: Command) {
.option('--verbose', 'Always print logs from Submission Service')
.description('Uploads an Android standalone app to Google Play Store.')
// TODO: make this work outside the project directory (if someone passes all necessary options for upload)
.asyncActionProjectDir(async (projectDir: string, options: any) => {
.asyncActionProjectDir(async (projectDir: string, options: AndroidSubmitCommandOptions) => {
// TODO: remove this once we verify `fastlane supply` works on linux / windows
if (!options.useSubmissionService) {
checkRuntimePlatform('android');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class AndroidSubmitCommand {
}

private resolveArchiveTypeSource(): ArchiveTypeSource {
const { archiveType: rawArchiveType } = this.ctx.commandOptions;
const { type: rawArchiveType } = this.ctx.commandOptions;
if (rawArchiveType) {
if (!(rawArchiveType in ArchiveType)) {
throw new Error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ import { v4 as uuidv4 } from 'uuid';
import { AndroidSubmitCommandOptions } from '../types';
import { SubmissionMode } from '../../types';
import AndroidSubmitCommand from '../AndroidSubmitCommand';
import {
AndroidSubmissionConfig,
ArchiveType,
ReleaseStatus,
ReleaseTrack,
} from '../AndroidSubmissionConfig';
import { ArchiveType, ReleaseStatus, ReleaseTrack } from '../AndroidSubmissionConfig';
import { mockExpoXDL } from '../../../../../__tests__/mock-utils';
import { createTestProject } from '../../../../../__tests__/project-utils';
import { jester } from '../../../../../__tests__/user-fixtures';
Expand Down Expand Up @@ -78,8 +73,8 @@ describe(AndroidSubmitCommand, () => {
it('sends a request to Submission Service', async () => {
const projectId = uuidv4();
(SubmissionService.getSubmissionAsync as jest.Mock).mockImplementationOnce(
async (id: string): Promise<Submission> => {
const actualSubmission = await originalGetSubmissionAsync(id);
async (projectId: string, submissionId: string): Promise<Submission> => {
const actualSubmission = await originalGetSubmissionAsync(projectId, submissionId);
return {
...actualSubmission,
status: SubmissionStatus.FINISHED,
Expand All @@ -90,7 +85,7 @@ describe(AndroidSubmitCommand, () => {

const options: AndroidSubmitCommandOptions = {
url: 'http://expo.io/fake.apk',
archiveType: 'apk',
type: 'apk',
key: '/google-service-account.json',
track: 'internal',
releaseStatus: 'draft',
Expand Down Expand Up @@ -129,7 +124,7 @@ describe(AndroidSubmitCommand, () => {
it('executes supply_android from traveling-fastlane', async () => {
const options: AndroidSubmitCommandOptions = {
path: '/apks/fake.apk',
archiveType: 'apk',
type: 'apk',
key: '/google-service-account.json',
track: 'internal',
releaseStatus: 'draft',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SubmissionContext, SubmitCommandOptions } from '../types';

export interface AndroidSubmitCommandOptions extends SubmitCommandOptions {
archiveType?: string;
type?: string;
key?: string;
androidPackage?: string;
track?: string;
Expand Down