test script

publishpplugins
filip mertens 2 years ago
parent fc6b2ef6cb
commit d6bc025f47
  1. 3
      .circleci/config.yml
  2. 4
      apps/remix-ide/ci/publish_plugin.sh
  3. 30
      apps/remix-ide/ci/publish_plugin.ts

@ -63,8 +63,7 @@ jobs:
- node_modules
- run: yarn build << parameters.plugin >>
- run: mkdir persist && zip -0 -r persist/plugin-<< parameters.plugin >>.zip dist
- run: sha1sum persist/plugin-<< parameters.plugin >>.zip
- run: ./apps/remix-ide/ci/publish_plugin.sh
- run: ./apps/remix-ide/ci/publish_plugin.sh << parameters.plugin >>
- persist_to_workspace:
root: .
paths:

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e
yarn run tsc --version
sha1sum persist/plugin-$1.zip
npx ts-node apps/remix-ide/ci/publish_plugin.ts 328782397 alpha
git clone git@github.com:ethereum/remix-plugins-directory.git

@ -0,0 +1,30 @@
import fetch from "node-fetch";
(async () => {
const pluginsDirectory = 'https://raw.githubusercontent.com/ethereum/remix-plugins-directory/master/build/metadata.json'
const metadata = await fetch(pluginsDirectory, { method: 'GET' })
// get command line arguments
const args = process.argv.slice(2)
const pluginName = args[0]
const sha = args[1]
const build = args[2]
if (!pluginName || !sha || !build) {
console.error('missing arguments')
process.exit(1)
}
// search for the plugin in the metadata
const plugins = await metadata.json()
const plugin = plugins.find((p: any) => p.name === pluginName)
if (!plugin) {
console.error('plugin not found')
process.exit(1)
}
// update the plugin
plugin.build = build
plugin.sha = sha
console.log('publishing plugin', plugin, 'with sha', sha, 'and build', build)
})()
Loading…
Cancel
Save