Skip to content

Commit

Permalink
Merge pull request #271 from Financial-Times/matth/fix-prerelease
Browse files Browse the repository at this point in the history
Fix prerelease workflow job
  • Loading branch information
i-like-robots authored Apr 18, 2019
2 parents 37e453b + 011f494 commit 4a1e973
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,18 @@ jobs:
name: shared-helper / npm-store-auth-token
command: .circleci/shared-helpers/helper-npm-store-auth-token
- run:
name: Bump version number
name: Extract tag name and 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}";
npx athloi -F ${TARGET_MODULE} version ${TARGET_VERSION};
- run:
name: Bump version number
command: npx athloi -F ${TARGET_MODULE} version ${TARGET_VERSION};
- run:
name: NPM publish
command: npx athloi -F ${TARGET_MODULE} publish -- --access=public --tag=pre-release
Expand Down

0 comments on commit 4a1e973

Please sign in to comment.