Skip to content

Commit

Permalink
chore: update release process
Browse files Browse the repository at this point in the history
  • Loading branch information
wwilsman committed Aug 3, 2020
1 parent e61e4d3 commit 827e2d9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 33 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ jobs:
steps:
- checkout
- run: yarn
- run: npx semantic-release
- run: ./release-percy.sh
workflows:
version: 2
Expand Down
5 changes: 4 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Releasing

Releasing of the `@percy/agent` package is handled automatically with the [semantic-release](https://github.com/semantic-release/semantic-release) package.
- Bump the version in package.json and commit the change
- Create a git tag for the new version
- Push the commit and tag to GitHub
- CircleCI will publish new versions of the package
24 changes: 0 additions & 24 deletions dependencies.yml

This file was deleted.

24 changes: 17 additions & 7 deletions release-percy.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
#!/bin/bash

# This script is responsible for shipping the `percy` shadow package.
# Set the npm registry auth token
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc

# Grab the local version and check to see if that version exists on npm
agentAlreadyReleased=$(npm view @percy/agent versions | grep $(node -p "require('./package.json').version"))

# If the package with that version has not yet been released, go ahead and release it.
if [ !$agentAlreadyReleased ]; then
npm publish
else
echo "Skipping @percy/agent publishing because the desired version has already been published."
fi

# Ship the `percy` shadow package
# https://www.npmjs.com/package/percy
#
# Release of the `@percy/agent` package is handled with semantic-release

# First we jam `percy` into the package name
sed -i 's/@percy\/agent/percy/g' package.json

# Next we grab the local version and check to see if that version exists on npm
packageAlreadyReleased=$(npm view percy versions | grep $(node -p "require('./package.json').version"))
percyAlreadyReleased=$(npm view percy versions | grep $(node -p "require('./package.json').version"))

# If the package with that version has not yet been released, go ahead and release it.
if [ !$packageAlreadyReleased ]; then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
if [ !$percyAlreadyReleased ]; then
npm publish
else
echo "Skipping percy package publishing because the desired version has already been published."
echo "Skipping percy publishing because the desired version has already been published."
fi

0 comments on commit 827e2d9

Please sign in to comment.