diff --git a/.circleci/config.yml b/.circleci/config.yml index 47c3220..4ececa8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,7 +12,12 @@ jobs: - run: yarn install - run: yarn build - run: yarn test + - run: + name: Preparing artifacts + command: yarn artifact + - store_artifacts: + path: ./artifacts workflows: - build-and-test: - jobs: - - build-and-test \ No newline at end of file + build-and-test: + jobs: + - build-and-test diff --git a/.gitignore b/.gitignore index 536fafa..c210546 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ dist/ node_modules/ -schemas/ \ No newline at end of file +schemas/ +artifacts/ diff --git a/bin/pack-artifact.sh b/bin/pack-artifact.sh new file mode 100755 index 0000000..92b7ebd --- /dev/null +++ b/bin/pack-artifact.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -eu + +# Prepare a directory for artifacts +BUNDLE_NAME="rapid-experiments-shared-$(git describe --always)" +OUTDIR="artifacts/$BUNDLE_NAME" +mkdir -p $OUTDIR + +# Copy all artifacts into it +cp -r ./schemas $OUTDIR + +# Bundle it +tar -czvf $OUTDIR.tar.gz $OUTDIR diff --git a/package.json b/package.json index 4752515..d25504d 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { - "name": "tiger-schemas", + "name": "rapid-experiments-shared", "version": "0.0.1", "license": "MPL-2.0", "scripts": { "build": "npm-run-all -s build:*", "build:json-schema": "./bin/build-schemas.ts", + "artifact": "./bin/pack-artifact.sh", "test": "npm-run-all -s test:*", "test:normandy-arguments": "./test/normandy-arguments.ts" }, - "dependencies": { - }, + "dependencies": {}, "devDependencies": { "@types/node": "^14.0.3", "@types/node-fetch": "^2.5.7",