Переглянути джерело

Merge branch 'master' of https://github.com/transloadit/uppy

Artur Paikin 6 роки тому
батько
коміт
902df5e6ba
3 змінених файлів з 21 додано та 6 видалено
  1. 13 4
      bin/make-new-versions-table
  2. 7 1
      bin/release
  3. 1 1
      bin/sync-version-numbers

+ 13 - 4
bin/make-new-versions-table

@@ -10,13 +10,22 @@
 
 const { execSync } = require('child_process')
 
-const stdout = execSync('git log --grep Release -1 --pretty=raw')
-const str = stdout.toString()
-const rx = /- ([@/\w]+)@(\d+\.\d+\.\d+)/g
+const logStdout = execSync('git log --grep \'Release$\' -1 --pretty=oneline --no-decorate')
+let match = /^([0-9a-f]+) .*?$/m.exec(logStdout.toString())
+if (!match) {
+  console.error('Could not read Release commit')
+  process.exit(1)
+}
+
+const commit = match[1]
+
+const tagStdout = execSync(`git tag --list --contains ${commit}`)
+const tags = tagStdout.toString()
+const rx = /([@/\w-]+)@(\d+\.\d+\.\d+)/g
 
 const versions = []
 let m
-while ((m = rx.exec(str))) {
+while ((m = rx.exec(tags))) {
   const [, pkg, version] = m
   versions.push({ pkg, version })
 }

+ 7 - 1
bin/release

@@ -32,7 +32,13 @@ if ! npm whoami > /dev/null; then
   exit 1
 fi
 
-if [ "$(npm profile get --json | jq .tfa.mode -r)" == "auth-and-writes" ]; then
+if ! which jq; then
+  echo "https://stedolan.github.io/jq/ needs to be installed and available in PATH to do a release."
+  exit 1
+fi
+
+perm="$(npm profile get --json | jq .tfa.mode -r)"
+if [ "$perm" == "auth-and-writes" ]; then
   echo "Two-factor auth is enabled for publishing. This doesn't work well with lerna."
   echo "Temporarily switch to authentication-only 2FA using the link below:"
   echo ""

+ 1 - 1
bin/sync-version-numbers

@@ -18,7 +18,7 @@ __file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
 __base="$(basename ${__file} .sh)"
 __root="$(cd "$(dirname "${__dir}")" && pwd)"
 
-if [ "$ENDTOEND" = "1" ]; then
+if [ "${ENDTOEND:=0}" = "1" ]; then
   echo "Publishing for e2e tests, skipping version number sync."
   exit 0
 fi