test script

pull/5370/head
filip mertens 2 years ago
parent 0eed6023cf
commit 8de534eb3e
  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 - node_modules
- run: yarn build << parameters.plugin >> - run: yarn build << parameters.plugin >>
- run: mkdir persist && zip -0 -r persist/plugin-<< parameters.plugin >>.zip dist - 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 << parameters.plugin >>
- run: ./apps/remix-ide/ci/publish_plugin.sh
- persist_to_workspace: - persist_to_workspace:
root: . root: .
paths: paths:

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