Skip to content
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

Auto-submit and local don't work together #1996

Open
georgevicbell opened this issue Aug 8, 2023 · 3 comments
Open

Auto-submit and local don't work together #1996

georgevicbell opened this issue Aug 8, 2023 · 3 comments
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@georgevicbell
Copy link

Build/Submit details page URL

No response

Summary

When using eas --auto-submit --local the build is not submitted after building.

I would expect that after a local build the submit process would happen automatically.

I am not too concerned about where the submit happens from, so it would be fine if the file was uploaded to EAS servers to be submitted...it may be necessary to make this clear by having:

eas
--build-remote (default)
--build-local
--auto-submit-none (default)
--auto-submit-local (if ever developed)
--auto-submit-remote

The functionality for --auto-submit-remote already exists, but you have to do eas submit (then paste location of the local file)

Managed or bare?

Managed

Environment

All

Error output

No response

Reproducible demo or steps to reproduce from a blank project

run eas --auto-submit --local

@georgevicbell georgevicbell added the needs review Issue is ready to be reviewed by a maintainer label Aug 8, 2023
@AdamGerthel
Copy link

I'd love to have this as well!

However, I can see why Expo wouldn't necessarily want to spend time making it easier to locally build and submit since that reduces the incentive to get the paid Expo EAS version. With that said, I'm guessing it's mainly useful for hobbyists or small teams that are unlikely to get the paid version of EAS anyway.

@MariuzM
Copy link

MariuzM commented Nov 30, 2023

Yep still an issue, i had impression that should work but i guess i was wrong

@MariuzM
Copy link

MariuzM commented Nov 30, 2023

If anyone finds this useful wrote small script that build locally and submits ipa to eas and apple connect

import { exec } from 'node:child_process';
import { readdir } from 'node:fs/promises';
import { join } from 'node:path';

const DIR = '.';
const PREFIX = 'build-';

async function getLatestBuild(): Promise<string | null> {
  try {
    const fileNames = await readdir(DIR);
    const buildFiles = fileNames.filter((fileName) => fileName.startsWith(PREFIX));
    buildFiles.sort((a, b) => {
      const timeA = parseInt(a.split('-')[1]);
      const timeB = parseInt(b.split('-')[1]);
      return timeB - timeA;
    });
    return buildFiles.length > 0 ? join(DIR, buildFiles[0]) : null;
  } catch (error) {
    console.error('Error reading directory:', error);
    return null;
  }
}

async function main() {
  const latestBuild = await getLatestBuild();

  if (latestBuild) {
    const submitCommand = `eas submit -p ios --path ${latestBuild}`;

    const childProcess = exec(submitCommand, (error, stdout, stderr) => {
      if (error) {
        console.error('Error running eas submit:', error.message);
        return;
      }
      console.log('eas submit output:', stdout);
    });

    childProcess.stdout?.on('data', (data) => console.log('↩︎', data.toString()));
    childProcess.stderr?.on('data', (data) => console.error('stderr:', data.toString()));
  } else {
    console.log('No build files found.');
  }
}

main();
  "scripts": {
    "submit": "bun run eas build --profile production --local -p ios && bun run scripts/run.ts",
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants