Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Replace Grunt-based build system with simple scripts - #12410

Merged
as-cii merged 212 commits into
masterfrom
ns-modernize-build
Aug 29, 2016
Merged

as-cii merged 212 commits into
masterfrom
ns-modernize-build

Conversation

@nathansobo

@nathansobo nathansobo commented Aug 12, 2016 •

Copy link
Copy Markdown
Contributor

Our existing Grunt-based build system is really difficult to follow, so this PR replaces it with a simpler approach involving plain old JavaScript.

The build directory is deleted, and instead the script directory takes on an expanded role, getting its own package.json and lib directories to support an overhauled version of script/bootstrap, script/build, and script/test. Instead of relying on Grunt, we do everything via functions defined in the script/lib directory.

Build script

The basic structure of the new build script is as follows:

  • Copy all sources to atom/out/app
  • Transpile Babel, CoffeeScript, and Less files in place
  • Generate pre-cached metadata
  • At this point, out/app is a valid Electron app that doesn't require transpilation support to run.
  • Run electron-packager on out/app to package it into a distributable application on the current platform.
  • Build installer on Windows, code sign on macOS
  • Zip stuff up

This is all designed to run only on third-party build providers (CircleCI for macOS, Travis for Linux, and AppVeyor on Windows). We've put zero effort into making these scripts run on internal Janky boxes.

Release publishing plan

We deliberately omit the artifact uploading step, because our plan is to orchestrate release publishing outside of the build. We'll rely on the build services to store artifacts associated with all builds, and when we're ready to release we'll have a script download these artifacts from Circle, Travis, and AppVeyor and upload them to the releases API and S3. This will help to ensure that all artifacts stay in sync based on a specific commit SHA.

Tasks

  • Build scripts working on all platforms
    • macOS
      • Build a complete electron app
      • Code sign
      • Green build on Circle
      • Implement --install flag
    • Windows
      • Build a complete electron app
      • Build an installer
      • Delete unnecessary .nupkg delta file uploaded as artifact
      • Code sign
      • Green build on AppVeyor
      • Installing won't be supported, because users can launch the generated installer.
    • Linux
      • Build a complete electron app
      • Generate .deb package
      • Generate .rpm package
      • Green build on Travis
      • Make Travis artifacts downloadable
      • Installing won't be supported, because users can launch the package manager on the generated packages.
  • Add script/lint
  • Release publishing
    • Visualize build status for release branch across all platforms
    • Download and publish artifacts for a specific SHA
    • Authenticate Atom maintainers that work for GitHub
    • Get app running on Heroku Enterprise
    • A pinch of styling
  • Documentation
    • Rewrite build instructions for macOS
    • Rewrite build instructions for Windows
    • Rewrite build instructions for Linux
  • Ops
    • Make builds a no-op on previous internal build systems.
    • Eliminate atom-private AppVeyor build and use private env vars instead

Nathan Sobo and others added 30 commits July 22, 2016 16:34
...as we don't need that function to be reusable anymore. We can always extract it later if needed.
We need to do this so we can transpile everything in place, but then we
should be able to run electron-packager directly on this directory.
...and use the same versions found on the root package.json.
@as-cii
as-cii force-pushed the ns-modernize-build branch from ebf68e7 to 9ee9db4 Compare August 29, 2016 08:40
@as-cii
as-cii merged commit c45b978 into master Aug 29, 2016
@as-cii
as-cii deleted the ns-modernize-build branch August 29, 2016 15:31
@maxbrunsfeld

Copy link
Copy Markdown
Contributor

📈 🎆 ❗

@mnquintana

Copy link
Copy Markdown
Contributor

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants