1
1
mirror of https://github.com/primer/css.git synced 2025-01-02 11:12:27 +03:00

Merge pull request #260 from primer/master

Merge master => dev
This commit is contained in:
Shawn Allen 2017-07-24 14:18:55 -07:00 committed by GitHub
commit a093959b3a
5 changed files with 78 additions and 25 deletions

View File

@ -11,3 +11,7 @@ script:
after_success:
- npm config set "//registry.npmjs.org/:_authToken=\${NPM_API_KEY}"
- script/cibuild --yes
notifications:
slack:
secure: W9lPRuuPMNwElkXZ8UZtu5phgUNleDCK0PgERa28dkh5b0Y9xzRpIQPRJfqVYAPtnMVXhfYcqryMzA4oj0E4fc7OxQsKmMeF1OcTuj5N4CM5xXR/qXDehOUTp6fpCToIX9d4hZ2H///PCExpul3TcfxYJe6EWQCHYd1n6zKRl8g=

View File

@ -1,5 +1,21 @@
# HEAD
# 9.1.0
This release updates our [stylelint config](/primer/stylelint-config-primer) to [v2.0.0](https://github.com/primer/stylelint-config-primer/releases/tag/v2.0.0), and to stylelint v7.13.0. Each module also now has a `lint` npm script, and there are top-level `test` and `lint` scripts that you can use to lint and test all modules in one go.
This release also includes major improvements to our Travis build scripts to automatically publish PR builds, release candidates, and the "final" versions to npm.
# 9.0.0
# 8.0.0
# 7.0.0
# 6.0.0
# 5.0.0
# 4.4.0
- Adding primer-marketing module to primer

View File

@ -5,18 +5,47 @@ set -e
# which makes this easier to test locally
args=$@
# always publish a pr release if this is a PR build
if [[ "$TRAVIS_EVENT_TYPE" = "pull_request" ]]; then
script/release-pr $args
# merges to dev build a release candidate
elif [[ "$TRAVIS_BRANCH" =~ "^release-" ]]; then
script/release-candidate $args
# publish a release when we merge to master
elif [[ "$TRAVIS_BRANCH" = "master" ]]; then
script/release $args
else
echo "⚠️ This isn't a PR and '$TRAVIS_BRANCH' isn't a release branch."
event="$TRAVIS_EVENT_TYPE"
branch="$TRAVIS_BRANCH"
# use $TRAVIS_PULL_REQUEST_BRANCH if this is a PR
if [[ "$event" = "pull_request" ]]; then
branch="$TRAVIS_PULL_REQUEST_BRANCH"
fi
echo "===== CI build ====="
echo " event: $event"
echo " branch: $branch"
echo "===================="
if [[ "$event" = "" || "$branch" = "" ]]; then
echo '❌ Missing $TRAVIS_EVENT_TYPE or $TRAVIS_BRANCH!'
exit 1
fi
# release branches publish a release candidate
if [[ "$branch" =~ ^release- ]]; then
# only publish RCs for push builds
if [[ "$event" = "push" ]]; then
script/notify pending
script/release-candidate $args
script/notify success
else
echo "⚠️ This appears to be a release branch, but we only publish *push* builds."
echo "(TRAVIS_EVENT_TYPE: $event)"
exit 1
fi
# always publish a pr release if this is a PR build
elif [[ "$event" = "pull_request" ]]; then
script/notify pending
script/release-pr $args
script/notify success
# publish a release when we merge to master
elif [[ "$branch" = "master" ]]; then
script/notify pending
script/release $args
script/notify success
else
echo "⚠️ This isn't a PR and '$branch' isn't a release branch."
exit 1
fi
script/notify

View File

@ -1,14 +1,26 @@
#!/bin/bash
set -e
if [[ $# -lt 1 ]]; then
echo "No status provided!" >&2
exit 1
fi
# the commit status context
context="npm publish"
_status=$1
# get the published version of primer-css from its package.json
package=primer-css
version=$(jq -r .version modules/$package/package.json)
published="$package@$version"
message=""
if [[ "$_status" = "success" ]]; then
# TODO point this at the contributing docs!
message="https://unpkg.com/$published/build/build.css"
fi
# XXX this will go away if we build pushes instead of PRs
if [[ "$TRAVIS_PULL_REQUEST_SHA" != "" ]]; then
# setting TRAVIS_COMMIT inline here is a fix for:
@ -17,6 +29,4 @@ if [[ "$TRAVIS_PULL_REQUEST_SHA" != "" ]]; then
fi
echo "📡 Transmitting publish status for $published..."
# TODO point this at the contributing docs!
commit-status success "$context" "$published" \
"https://unpkg.com/$published/build/build.css"
commit-status "$_status" "$context" "$published" "$message"

View File

@ -12,10 +12,6 @@ function bump() {
npm version --no-git $@
}
function publish() {
npm publish --silent --tag=$npm_tag $@
}
# get the version we're publishing as a release candidate
local_version=$(jq -r .version modules/$package/package.json)
if [[ $local_version =~ "-" ]]; then
@ -40,16 +36,14 @@ echo "🤜 Next version: $package@$next_version"
pre_version=${next_version:${#local_version}}
echo " Prerelease suffix: '$pre_version'"
# get the name of every module
# FIXME there's gotta be a better way to do this
modules=$(lerna exec pwd | xargs basename)
# if this is the same version, we need to bump the prerelease
# for all of the modules using the same prerelease identifier
echo "Updating all module versions in place..."
echo
for module in $modules; do
pushd modules/$module > /dev/null
module_dirs=modules/primer-*
for module_dir in $module_dirs; do
pushd $module_dir > /dev/null
module=$(basename $module_dir)
# determine the local version (in git)
module_version=$(jq -r .version package.json)