Skip to content
Permalink
Browse files

build: clean up scripts folder, move release scripts, move zip manife…

…st logic (#18945)

* build: move zip manifest logic in zip_manifests dir

* build: remove unused get-version.py script

* chore: move all release/sudowoodo related scripts into script/releases

* chore: update paths to zip manifests in CI configs

* build: fix path to ci release build script for arm tests
  • Loading branch information...
MarshallOfSound committed Jun 24, 2019
1 parent 5686a07 commit fb01c94511c42a72440e0503d1cb5499229fc7c0
Showing with 121 additions and 146 deletions.
  1. +4 −4 .circleci/config.yml
  2. +1 −10 .github/CODEOWNERS
  3. +3 −3 appveyor.yml
  4. +0 −1 package.json
  5. +0 −23 script/get-last-major-for-master.js
  6. +0 −12 script/get-version.py
  7. +3 −0 script/lib/util.py
  8. +6 −2 script/lib/utils.js
  9. 0 script/{ → release}/ci-release-build.js
  10. 0 script/{find-release.js → release/find-github-release.js}
  11. +3 −0 script/{ → release}/merge-electron-checksums.py
  12. 0 script/{release-notes → release/notes}/.gitignore
  13. +2 −3 script/{release-notes → release/notes}/index.js
  14. +8 −7 script/{release-notes → release/notes}/notes.js
  15. +7 −8 script/{ → release}/prepare-release.js
  16. +3 −3 script/{ → release}/publish-to-npm.js
  17. +3 −4 script/{ → release}/release-artifact-cleanup.js
  18. +6 −19 script/{ → release}/release.js
  19. +4 −3 script/{ → release/uploaders}/upload-index-json.py
  20. +2 −0 script/{ → release/uploaders}/upload-node-checksums.py
  21. +2 −1 script/{ → release/uploaders}/upload-node-headers.py
  22. +4 −3 script/{ → release/uploaders}/upload-symbols.py
  23. 0 script/{ → release/uploaders}/upload-to-github.js
  24. +14 −10 script/{ → release/uploaders}/upload.py
  25. +20 −21 script/{bump-version.js → release/version-bumper.js}
  26. +22 −5 script/{lib → release}/version-utils.js
  27. 0 script/{ → zip_manifests}/check-zip-manifest.py
  28. 0 script/{ → zip_manifests}/dist_zip.linux.arm.manifest
  29. 0 script/{ → zip_manifests}/dist_zip.linux.arm64.manifest
  30. 0 script/{ → zip_manifests}/dist_zip.linux.x64.manifest
  31. 0 script/{ → zip_manifests}/dist_zip.linux.x86.manifest
  32. 0 script/{ → zip_manifests}/dist_zip.mac.x64.manifest
  33. 0 script/{ → zip_manifests}/dist_zip.mac_mas.x64.manifest
  34. 0 script/{ → zip_manifests}/dist_zip.win.ia32.manifest
  35. 0 script/{ → zip_manifests}/dist_zip.win.x64.manifest
  36. +4 −4 spec/version-bump-spec.js
@@ -309,7 +309,7 @@ step-electron-dist-build: &step-electron-dist-build
echo "Unknown system: `uname`"
exit 1
fi
electron/script/check-zip-manifest.py out/Default/dist.zip electron/script/dist_zip.$target_os.$target_cpu.manifest
electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.$target_os.$target_cpu.manifest
fi
step-electron-dist-store: &step-electron-dist-store
@@ -350,10 +350,10 @@ step-electron-publish: &step-electron-publish
cd src/electron
if [ "$UPLOAD_TO_S3" == "1" ]; then
echo 'Uploading Electron release distribution to S3'
script/upload.py --upload_to_s3
script/release/uploaders/upload.py --upload_to_s3
else
echo 'Uploading Electron release distribution to Github releases'
script/upload.py
script/release/uploaders/upload.py
fi
step-persist-data-for-tests: &step-persist-data-for-tests
@@ -521,7 +521,7 @@ step-maybe-trigger-arm-test: &step-maybe-trigger-arm-test
if [ "$TRIGGER_ARM_TEST" == "true" ] && [ -z "$CIRCLE_PR_NUMBER" ]; then
#Trigger VSTS job, passing along CircleCI job number and branch to build
echo "Triggering electron-$TARGET_ARCH-testing build on VSTS"
node electron/script/ci-release-build.js --job=electron-$TARGET_ARCH-testing --ci=VSTS --armTest --circleBuildNum=$CIRCLE_BUILD_NUM $CIRCLE_BRANCH
node electron/script/release/ci-release-build.js --job=electron-$TARGET_ARCH-testing --ci=VSTS --armTest --circleBuildNum=$CIRCLE_BUILD_NUM $CIRCLE_BRANCH
fi
step-maybe-generate-typescript-defs: &step-maybe-generate-typescript-defs
@@ -18,13 +18,4 @@

# Releases WG
/npm/ @electron/wg-releases
/script/release-notes @electron/wg-releases
/script/prepare-release.js @electron/wg-releases
/script/bump-version.js @electron/wg-releases
/script/ci-release-build.js @electron/wg-releases
/script/release.js @electron/wg-releases
/script/upload-to-github.js @electron/wg-releases
/script/release-artifact-cleanup.js @electron/wg-releases
/script/get-last-major-for-master.js @electron/wg-releases
/script/find-release.js @electron/wg-releases
/script/download-circleci-artifacts.js @electron/wg-releases
/script/release @electron/wg-releases
@@ -97,7 +97,7 @@ build_script:
python electron\script\zip-symbols.py
appveyor PushArtifact out/Default/symbols.zip
}
- python electron/script/check-zip-manifest.py out/Default/dist.zip electron/script/dist_zip.win.%TARGET_ARCH%.manifest
- python electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest
test_script:
# Workaround for https://github.com/appveyor/ci/issues/2420
- set "PATH=%PATH%;C:\Program Files\Git\mingw64\libexec\git-core"
@@ -125,9 +125,9 @@ deploy_script:
if (Test-Path Env:\ELECTRON_RELEASE) {
if (Test-Path Env:\UPLOAD_TO_S3) {
Write-Output "Uploading Electron release distribution to s3"
& python script\upload.py --upload_to_s3
& python script\release\uploaders\upload.py --upload_to_s3
} else {
Write-Output "Uploading Electron release distribution to github releases"
& python script\upload.py
& python script\release\uploaders\upload.py
}
}
@@ -60,7 +60,6 @@
"private": true,
"scripts": {
"asar": "asar",
"bump-version": "./script/bump-version.js",
"check-tls": "python ./script/tls.py",
"clang-format": "find atom/ chromium_src/ -iname *.h -o -iname *.cc -o -iname *.mm | xargs clang-format -i",
"generate-version-json": "node script/generate-version-json.js",

This file was deleted.

This file was deleted.

@@ -22,6 +22,9 @@
from lib.config import is_verbose_mode, PLATFORM
from lib.env_util import get_vs_env

ELECTRON_DIR = os.path.abspath(
os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
)
SRC_DIR = os.path.abspath(os.path.join(__file__, '..', '..', '..', '..'))
BOTO_DIR = os.path.abspath(os.path.join(__file__, '..', '..', '..', 'vendor',
'boto'))
@@ -2,6 +2,8 @@ const { GitProcess } = require('dugite')
const fs = require('fs')
const path = require('path')

const ELECTRON_DIR = path.resolve(__dirname, '..', '..')
const SRC_DIR = path.resolve(ELECTRON_DIR, '..')
const OUT_DIR = process.env.ELECTRON_OUT_DIR || 'Debug'

require('colors')
@@ -22,7 +24,7 @@ function getElectronExec () {
}

function getAbsoluteElectronExec () {
return path.resolve(__dirname, '../../..', getElectronExec())
return path.resolve(SRC_DIR, getElectronExec())
}

async function handleGitCall (args, gitDir) {
@@ -61,5 +63,7 @@ module.exports = {
getCurrentBranch,
getElectronExec,
getAbsoluteElectronExec,
OUT_DIR
ELECTRON_DIR,
OUT_DIR,
SRC_DIR
}
File renamed without changes.
File renamed without changes.
@@ -6,8 +6,11 @@
from __future__ import print_function

import argparse
import os
import sys

sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/..")

from lib.config import s3_config
from lib.util import boto_path_dirs

File renamed without changes.
@@ -5,14 +5,13 @@ const minimist = require('minimist')
const path = require('path')
const semver = require('semver')

const { ELECTRON_DIR } = require('../../lib/utils')
const notesGenerator = require('./notes.js')

const gitDir = path.resolve(__dirname, '..', '..')

const semverify = version => version.replace(/^origin\//, '').replace('x', '0').replace(/-/g, '.')

const runGit = async (args) => {
const response = await GitProcess.exec(args, gitDir)
const response = await GitProcess.exec(args, ELECTRON_DIR)
if (response.exitCode !== 0) {
throw new Error(response.stderr.trim())
}
@@ -11,13 +11,14 @@ const octokit = require('@octokit/rest')({
})
const semver = require('semver')

const { ELECTRON_VERSION, SRC_DIR } = require('../../lib/utils')

const MAX_FAIL_COUNT = 3
const CHECK_INTERVAL = 5000

const CACHE_DIR = path.resolve(__dirname, '.cache')
const NO_NOTES = 'No notes'
const FOLLOW_REPOS = [ 'electron/electron', 'electron/libchromiumcontent', 'electron/node' ]
const gitDir = path.resolve(__dirname, '..', '..')

const breakTypes = new Set(['breaking-change'])
const docTypes = new Set(['doc', 'docs'])
@@ -373,11 +374,11 @@ const getDependencyCommitsGyp = async (pool, fromRef, toRef) => {
const repos = [{
owner: 'electron',
repo: 'libchromiumcontent',
dir: path.resolve(gitDir, 'vendor', 'libchromiumcontent')
dir: path.resolve(ELECTRON_VERSION, 'vendor', 'libchromiumcontent')
}, {
owner: 'electron',
repo: 'node',
dir: path.resolve(gitDir, 'vendor', 'node')
dir: path.resolve(ELECTRON_VERSION, 'vendor', 'node')
}]

for (const repo of repos) {
@@ -393,7 +394,7 @@ const getDependencyCommitsGyp = async (pool, fromRef, toRef) => {

const getDepsVariable = async (ref, key) => {
// get a copy of that reference point's DEPS file
const deps = await runGit(gitDir, ['show', `${ref}:DEPS`])
const deps = await runGit(ELECTRON_VERSION, ['show', `${ref}:DEPS`])
const filename = path.resolve(os.tmpdir(), 'DEPS')
fs.writeFileSync(filename, deps)

@@ -413,7 +414,7 @@ const getDependencyCommitsGN = async (pool, fromRef, toRef) => {
const repos = [{ // just node
owner: 'electron',
repo: 'node',
dir: path.resolve(gitDir, '..', 'third_party', 'electron_node'),
dir: path.resolve(SRC_DIR, 'third_party', 'electron_node'),
deps_variable_name: 'node_version'
}]

@@ -429,7 +430,7 @@ const getDependencyCommitsGN = async (pool, fromRef, toRef) => {
// other repos - controller

const getDependencyCommits = async (pool, from, to) => {
const filename = path.resolve(gitDir, 'vendor', 'libchromiumcontent')
const filename = path.resolve(ELECTRON_VERSION, 'vendor', 'libchromiumcontent')
const useGyp = fs.existsSync(filename)

return useGyp
@@ -474,7 +475,7 @@ const getNotes = async (fromRef, toRef, newVersion) => {
}

// get the electron/electron commits
const electron = { owner: 'electron', repo: 'electron', dir: gitDir }
const electron = { owner: 'electron', repo: 'electron', dir: ELECTRON_VERSION }
await addRepoToPool(pool, electron, fromRef, toRef)

// Don't include submodules if comparing across major versions;
@@ -13,8 +13,8 @@ const { GitProcess } = require('dugite')

const path = require('path')
const readline = require('readline')
const releaseNotesGenerator = require('./release-notes/index.js')
const { getCurrentBranch } = require('./lib/utils.js')
const releaseNotesGenerator = require('./notes/index.js')
const { getCurrentBranch, ELECTRON_DIR } = require('../lib/utils.js')
const bumpType = args._[0]
const targetRepo = bumpType === 'nightly' ? 'nightlies' : 'electron'

@@ -28,12 +28,11 @@ if (!bumpType && !args.notesOnly) {
process.exit(1)
}

const gitDir = path.resolve(__dirname, '..')
async function getNewVersion (dryRun) {
if (!dryRun) {
console.log(`Bumping for new "${bumpType}" version.`)
}
const bumpScript = path.join(__dirname, 'bump-version.js')
const bumpScript = path.join(__dirname, 'version-bumper.js')
const scriptArgs = ['node', bumpScript, `--bump=${bumpType}`]
if (dryRun) scriptArgs.push('--dryRun')
try {
@@ -122,7 +121,7 @@ async function createRelease (branchToTarget, isBeta) {
}

async function pushRelease (branch) {
const pushDetails = await GitProcess.exec(['push', 'origin', `HEAD:${branch}`, '--follow-tags'], gitDir)
const pushDetails = await GitProcess.exec(['push', 'origin', `HEAD:${branch}`, '--follow-tags'], ELECTRON_DIR)
if (pushDetails.exitCode === 0) {
console.log(`${pass} Successfully pushed the release. Wait for ` +
`release builds to finish before running "npm run release".`)
@@ -141,7 +140,7 @@ async function runReleaseBuilds (branch) {

async function tagRelease (version) {
console.log(`Tagging release ${version}.`)
const checkoutDetails = await GitProcess.exec([ 'tag', '-a', '-m', version, version ], gitDir)
const checkoutDetails = await GitProcess.exec([ 'tag', '-a', '-m', version, version ], ELECTRON_DIR)
if (checkoutDetails.exitCode === 0) {
console.log(`${pass} Successfully tagged ${version}.`)
} else {
@@ -183,7 +182,7 @@ async function promptForVersion (version) {
// function to determine if there have been commits to master since the last release
async function changesToRelease () {
const lastCommitWasRelease = new RegExp(`^Bump v[0-9.]*(-beta[0-9.]*)?(-nightly[0-9.]*)?$`, 'g')
const lastCommit = await GitProcess.exec(['log', '-n', '1', `--pretty=format:'%s'`], gitDir)
const lastCommit = await GitProcess.exec(['log', '-n', '1', `--pretty=format:'%s'`], ELECTRON_DIR)
return !lastCommitWasRelease.test(lastCommit.stdout)
}

@@ -192,7 +191,7 @@ async function prepareRelease (isBeta, notesOnly) {
const newVersion = await getNewVersion(true)
console.log(newVersion)
} else {
const currentBranch = (args.branch) ? args.branch : await getCurrentBranch(gitDir)
const currentBranch = (args.branch) ? args.branch : await getCurrentBranch(ELECTRON_DIR)
if (notesOnly) {
const newVersion = await getNewVersion(true)
const releaseNotes = await getReleaseNotes(currentBranch, newVersion)
@@ -2,10 +2,10 @@ const temp = require('temp')
const fs = require('fs')
const path = require('path')
const childProcess = require('child_process')
const { getCurrentBranch } = require('./lib/utils.js')
const { getCurrentBranch, ELECTRON_DIR } = require('../lib/utils')
const request = require('request')
const semver = require('semver')
const rootPackageJson = require('../package.json')
const rootPackageJson = require('../../package.json')
const octokit = require('@octokit/rest')({
headers: { 'User-Agent': 'electron-npm-publisher' }
})
@@ -55,7 +55,7 @@ new Promise((resolve, reject) => {
const noThirdSegment = name === 'README.md' || name === 'LICENSE'
fs.writeFileSync(
path.join(tempDir, name),
fs.readFileSync(path.join(__dirname, '..', noThirdSegment ? '' : 'npm', name))
fs.readFileSync(path.join(ELECTRON_DIR, noThirdSegment ? '' : 'npm', name))
)
})
// copy from root package.json to temp/package.json
@@ -10,14 +10,13 @@ const args = require('minimist')(process.argv.slice(2), {
})
const { execSync } = require('child_process')
const { GitProcess } = require('dugite')
const { getCurrentBranch } = require('./lib/utils.js')
const { getCurrentBranch, ELECTRON_DIR } = require('../lib/utils.js')

const octokit = require('@octokit/rest')({
auth: process.env.ELECTRON_GITHUB_TOKEN
})

const path = require('path')
const gitDir = path.resolve(__dirname, '..')

function getLastBumpCommit (tag) {
const data = execSync(`git log -n1 --grep "Bump ${tag}" --format='format:{"hash": "%H", "message": "%s"}'`).toString()
@@ -27,8 +26,8 @@ function getLastBumpCommit (tag) {
async function revertBumpCommit (tag) {
const branch = await getCurrentBranch()
const commitToRevert = getLastBumpCommit(tag).hash
await GitProcess.exec(['revert', commitToRevert], gitDir)
const pushDetails = await GitProcess.exec(['push', 'origin', `HEAD:${branch}`, '--follow-tags'], gitDir)
await GitProcess.exec(['revert', commitToRevert], ELECTRON_DIR)
const pushDetails = await GitProcess.exec(['push', 'origin', `HEAD:${branch}`, '--follow-tags'], ELECTRON_DIR)
if (pushDetails.exitCode === 0) {
console.log(`${pass} successfully reverted release commit.`)
} else {

0 comments on commit fb01c94

Please sign in to comment.
You can’t perform that action at this time.