-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from identity-com/feature/build-version
Set the release process and update docs
- Loading branch information
Showing
32 changed files
with
5,208 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,42 @@ workflows: | |
jobs: | ||
- build | ||
|
||
build-tag: | ||
jobs: | ||
- build: | ||
filters: | ||
tags: | ||
only: /^release\..*$/ | ||
branches: | ||
ignore: /.*/ | ||
- release: | ||
context: Production | ||
requires: | ||
- build | ||
filters: | ||
tags: | ||
only: /^release\..*$/ | ||
branches: | ||
ignore: /.*/ | ||
|
||
deploy-npm: | ||
jobs: | ||
- build: | ||
filters: | ||
tags: | ||
only: /^v\d+\.\d+\.\d+.*/ | ||
branches: | ||
ignore: /.*/ | ||
- deploy: | ||
context: Production | ||
requires: | ||
- build | ||
filters: | ||
tags: | ||
only: /^v\d+\.\d+\.\d+.*/ | ||
branches: | ||
ignore: /.*/ | ||
|
||
|
||
jobs: | ||
build: | ||
|
@@ -39,3 +75,58 @@ jobs: | |
- persist_to_workspace: | ||
root: ~/repo | ||
paths: . | ||
|
||
release: | ||
<<: *defaults | ||
environment: | ||
HUB_ARTIFACT_VERSION: 2.7.0 | ||
HUB_ARTIFACT: hub-linux-amd64-2.7.0 | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }}-{{checksum "package-lock.json"}} | ||
- run: sudo apt-get update | ||
- run: sudo npm install -g npm | ||
- run: | | ||
sh ./.circleci/install_hub.sh | ||
mkdir -p ~/.config/ && echo -e "github.com:\n- user: civictechuser\n oauth_token: $GITHUB_API_KEY\n protocol: https\n" > ~/.config/hub | ||
- run: npm ci | ||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "package.json" }}-{{checksum "package-lock.json"}} | ||
- run: | ||
name: run lint check | ||
command: npm run lint | ||
- run: | ||
name: run tests | ||
command: npm run test | ||
- run: npm run build | ||
- run: | ||
name: git config | ||
command: | | ||
git config credential.helper 'cache --timeout=120' | ||
git config user.email "[email protected]" | ||
git config user.name "CI Deployer" | ||
git config --global push.default simple | ||
- run: | ||
name: create release | ||
command: npm run release:create | ||
- run: | ||
name: delete release tag | ||
command: git push --delete origin $CIRCLE_TAG | ||
- run: | | ||
hub release delete $CIRCLE_TAG | ||
deploy: | ||
<<: *defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/repo | ||
- run: | ||
name: authenticate with registry | ||
command: echo "//registry.npmjs.org/:_authToken=$IDENTITY_NPM_TOKEN" > ~/repo/.npmrc | ||
- run: | ||
name: publish package | ||
command: npm publish --access=public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
mkdir -p .hub_tmp | ||
cd .hub_tmp | ||
|
||
if [ ! -f "$HUB_ARTIFACT.tgz" ]; then | ||
wget https://github.com/github/hub/releases/download/v$HUB_ARTIFACT_VERSION/$HUB_ARTIFACT.tgz | ||
fi | ||
|
||
tar -xvzf $HUB_ARTIFACT.tgz | ||
sudo ./$HUB_ARTIFACT/install | ||
|
||
rm -rf ./$HUB_ARTIFACT |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.