From 55d0c86ab2f953be3b66ee7f4b4835f8dda5cdfe Mon Sep 17 00:00:00 2001 From: Seena Rowhani Date: Fri, 30 Nov 2018 14:03:55 -0500 Subject: [PATCH] fix(build): update package to build after release --- .travis.yml | 2 +- scripts/generate-versions.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 scripts/generate-versions.js diff --git a/.travis.yml b/.travis.yml index c359b3e..113ecc4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ script: - yarn test - yarn build after_success: - - npm run travis-deploy-once "npm run semantic-release" + - yarn travis-deploy-once "yarn semantic-release && yarn build" branches: only: - master diff --git a/scripts/generate-versions.js b/scripts/generate-versions.js new file mode 100755 index 0000000..2598320 --- /dev/null +++ b/scripts/generate-versions.js @@ -0,0 +1,18 @@ +#!/usr/bin/env node +const fs = require('fs') +const fetch = require('node-fetch') + +;(async () => { + const repoTags = await fetch('https://api.github.com/repos/srowhani/ember-artisans/tags') + .then(response => response.json()) + + const repoMapping = repoTags.reduce( + (acc, { name, commit }) => ({ + ...acc, + [name]: commit + }) + , {}) + + fs.writeFileSync('./tests/dummy/public/versions.json', JSON.stringify(repoMapping, null, 2)) +})() +