Skip to content

Commit

Permalink
chore: fix release utils pathing
Browse files Browse the repository at this point in the history
  • Loading branch information
RasPhilCo committed May 1, 2020
1 parent c0e0d5f commit 2b65a91
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scripts/release/deb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const qq = require('qqjs')

qq.config.silent = false
qq.run(async () => {
await require('../utils/_update_channel')()
await require('./utils/_update_channel')()
await qq.x('echo "$HEROKU_DEB_SECRET_KEY" | base64 -d | gpg --import')
await qq.x('./node_modules/.bin/oclif-dev pack:deb')
await qq.x('./node_modules/.bin/oclif-dev publish:deb')
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/homebrew
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [[ -z "${CIRCLE_TAG}" ]]; then
exit
fi

./scripts/utils/_github_setup
./scripts/release/utils/_github_setup

rm -rf tmp/homebrew-brew
git config --global core.pager cat
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/macos_installer_trigger
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [[ -z "${CIRCLE_TAG}" ]]; then
exit
fi

./scripts/utils/_github_setup
./scripts/release/utils/_github_setup

VERSION=$(node -p "require('./packages/cli/package.json').version")

Expand Down
2 changes: 1 addition & 1 deletion scripts/release/tarballs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const qq = require('qqjs')

qq.config.silent = false
qq.run(async () => {
await require('../utils/_update_channel')()
await require('./utils/_update_channel')()
await qq.x('./node_modules/.bin/oclif-dev pack')
await qq.x('./node_modules/.bin/oclif-dev publish')
})
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions scripts/release/utils/_update_channel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const qq = require('qqjs')

module.exports = async () => {
const pjson = await qq.readJSON('./package.json')
if (process.env.CIRCLE_TAG && process.env.CIRCLE_TAG.startsWith('v')) {
pjson.version = pjson.version.split('-')[0]
} else if (process.env.CIRCLE_BRANCH === 'master') {
pjson.version = pjson.version.split('-')[0] + '-beta'
} else {
pjson.version = pjson.version.split('-')[0] + '-dev'
}
await qq.writeJSON('./package.json', pjson)
}
11 changes: 11 additions & 0 deletions scripts/release/utils/_version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const qq = require('qqjs')

module.exports = async () => {
let { version } = require('../../packages/cli/package.json')
if (version.includes('-')) {
let channel = version.split('-')[1].split('.')[0]
let sha = await qq.x.stdout('git', ['rev-parse', '--short', 'HEAD'])
version = `${version.split('-')[0]}-${channel}.${sha}`
}
return version
}
4 changes: 2 additions & 2 deletions scripts/release/win
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const qq = require('qqjs')

qq.config.silent = false
qq.run(async () => {
await require('../utils/_update_channel')()
const version = await require('../utils/_version')()
await require('./utils/_update_channel')()
const version = await require('./utils/_version')()
await qq.x('./node_modules/.bin/oclif-dev pack:win')
await qq.x('echo "$HEROKU_WINDOWS_KEY" | base64 --decode > /tmp/heroku-windows-key')
await qq.x(`mv dist/win/heroku-v${version}-x86.exe dist/win/heroku-v${version}-x86-unsigned.exe`)
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ parts:
tar xvzf heroku.tar.gz
rmdir ../install
mv package ../install
OS=linux ./scripts/utils/_fetch_node_binary ../install/bin
OS=linux ./scripts/release/utils/_fetch_node_binary ../install/bin
cd ../install && yarn --prod
cd ../install && bin/run -v
sed -i 's/#!\/usr\/bin\/env node/#!\/snap\/heroku\/current\/bin\/node/' ../install/bin/run
Expand Down

0 comments on commit 2b65a91

Please sign in to comment.