ci-versions.js 799 Bytes
Newer Older
1 2 3 4 5 6 7 8
const os = require('os')

// this script unbundles the published packages output
// from changesets action to a key-value pair to be used
// with our publishing CI workflow
data = process.argv[2]
data = JSON.parse(data)

9 10 11 12 13 14
// Packages that do not depend on the builder.
// There are more packages that depend on the
// builder than not, so keep track of this list instead
const nonBuilders = new Set([
  'l2geth',
  'gas-oracle',
Mark Tyneway's avatar
Mark Tyneway committed
15 16
  'proxyd',
  'rpc-proxy',
17 18
])

19 20 21
builder = false
for (const i of data) {
  const name = i.name.replace("@eth-optimism/", "")
22
  if (!nonBuilders.has(name)) {
23 24 25 26 27 28 29
    builder = true
  }
  const version = i.version
  process.stdout.write(`::set-output name=${name}::${version}` + os.EOL)
}

if (builder) {
30
  process.stdout.write(`::set-output name=use_builder::true` + os.EOL)
31 32
}