Skip to content

Commit

Permalink
Merge pull request #266 from Financial-Times/matth/prerelease-dist-tag
Browse files Browse the repository at this point in the history
Publish prereleases under 'pre-release' tag not latest
  • Loading branch information
i-like-robots authored Mar 14, 2019
2 parents 124ed25 + 1143b1b commit a16aebb
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,22 +153,17 @@ jobs:
name: shared-helper / npm-store-auth-token
command: .circleci/shared-helpers/helper-npm-store-auth-token
- run:
name: Extract tag name and version number
name: Bump version number
command: |
# https://circleci.com/docs/2.0/env-vars/#using-bash_env-to-set-environment-variables
export PRERELEASE_SEMVER='v0\.[0-9]{1,2}\.[0-9]{1,2}(-[a-z]+\.[0-9])?'
export TARGET_VERSION=$(echo $CIRCLE_TAG | grep -o -E $PRERELEASE_SEMVER);
export TARGET_MODULE=$(echo $CIRCLE_TAG | sed -E "s/-${PRERELEASE_SEMVER}//g");
echo "export TARGET_VERSION=$TARGET_VERSION" >> $BASH_ENV;
echo "export TARGET_MODULE=$TARGET_MODULE" >> $BASH_ENV;
echo "Creating prerelease ${TARGET_VERSION} for ${TARGET_MODULE}";
- run:
name: Bump version
command: |
npx athloi -F ${TARGET_MODULE} version ${TARGET_VERSION};
- run:
name: NPM publish
command: npx athloi -F ${TARGET_MODULE} publish -- --access=public
command: npx athloi -F ${TARGET_MODULE} publish -- --access=public --tag=pre-release

deploy:
<<: *container_config_node8
Expand Down

0 comments on commit a16aebb

Please sign in to comment.