1
1
mirror of https://github.com/primer/css.git synced 2024-12-29 17:12:27 +03:00

write published primer version to /VERSION, use that

This commit is contained in:
Shawn Allen 2019-01-02 22:53:31 -08:00
parent 0935b47688
commit 5efe7b38d5
2 changed files with 10 additions and 4 deletions

View File

@ -0,0 +1,6 @@
const fs = require('fs')
const {join} = require('path')
const version = require('../package.json').version
const path = join(__dirname, '../../../VERSION')
fs.writeFileSync(path, version, 'utf8')

View File

@ -8,7 +8,7 @@ else
cd docs
npm run sync
version=$(jq -r .version ../modules/primer/package.json)
version=$(cat ../VERSION)
actual=$(jq -r .dependencies.primer package.json)
# here, we need to manually update the primer dependency
@ -17,8 +17,8 @@ else
jq ".dependencies.primer = \"$version\"" package.json > package.json.tmp
mv package.json.tmp package.json
now="now --token=$NOW_TOKEN"
$now | tee now-url.txt
now_args="--token=$NOW_TOKEN"
now $now_args | tee now-url.txt
url=$(cat now-url.txt)
npx commit-status success docs "deployed primer@$version to $url" "$url"
if [[ $TRAVIS_EVENT_TYPE = "pull_request" ]]; then
@ -28,7 +28,7 @@ else
fi
alias="primer-css-${branch//\./-}.now.sh"
echo "aliasing..."
$now alias $url $alias
now $now_args alias $url $alias
url="https://$alias"
npx commit-status success docs "deployed primer@$version to $url" "$url"
fi