Skip to content

Commit

Permalink
Merge pull request #1972 from cosmos/sabau/auto-release-PR-first-step
Browse files Browse the repository at this point in the history
Auto release: Creating PR overnight
  • Loading branch information
faboweb authored Feb 14, 2019
2 parents 2e0444e + b12af2a commit f1809de
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 24 deletions.
24 changes: 8 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,21 +255,8 @@ jobs:
git push --delete bot release-candidate
npm -g uninstall yarn ; npm -g install [email protected]
sudo tasks/build/installWine.sh
yarn install
# download network configs
# skip as this will overwrite game of stakes
# tasks/build/testnets/build.sh
# build Voyager
node tasks/build/build.js
# test linux build
tar -zxvf ./builds/Voyager/Cosmos_Voyager-*-Linux.tar.gz
yarn test:exe "./Cosmos Voyager"
node tasks/publish.js
fi
Expand Down Expand Up @@ -340,9 +327,14 @@ workflows:
branches:
only: develop

# Every UTC midnight we go on develop and release
release:
jobs:
- release:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only: release
only:
- develop
jobs:
- release
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- [\#1866](https://github.com/cosmos/voyager/issues/1866) Added blocks to network page and a page for viewing individual blocks @jbibla
- [\#1911](https://github.com/cosmos/voyager/issues/1911) Upload code to Sentry for remote error analyzer @faboweb
- Added development mode warning @faboweb
- [\#1972](https://github.com/cosmos/voyager/pull/1972) Add auto PR cron job to circle ci @sabau

### Changed

Expand Down
5 changes: 3 additions & 2 deletions tasks/createReleasePR.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const pushCommit = ({ token, branch }) =>
set -o verbose
git config --local user.name "Voyager Bot"
git config --local user.email "[email protected]"
git commit --all --message="Bump version for release."
git add CHANGELOG.md package.json
git commit --message="Bump version for release."
git tag --force release-candidate
git remote add bot https://${token}@github.com/cosmos/voyager.git
git push --force --tags bot HEAD:${branch}
Expand All @@ -47,7 +48,7 @@ const createPullRequest = async ({ changeLog, token, tag, head }) => {
repo: `voyager`,
title: `automatic release created for ${tag}`,
head,
base: `develop`,
base: `master`,
body: recentChanges(changeLog),
maintainer_can_modify: true
})
Expand Down
7 changes: 2 additions & 5 deletions tasks/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ const path = require(`path`)
const release = require(`publish-release`)
const util = require(`util`)

const assetsDir = path.join(__dirname, `../builds/Voyager`)

const recentChanges = changeLog =>
changeLog.match(/.+?## .+?\n## .+?\n\n(.+?)\n## /s)[1]

const createNotes = changeLog => `NOTE: DO NOT ENTER YOUR FUNDRAISER SEED. THIS SOFTWARE HAS NOT BEEN AUDITED.
NEVER ENTER YOUR FUNDRAISER SEED 12 WORDS ONTO AN ONLINE COMPUTER.
NEVER ENTER YOUR FUNDRAISER SEED 24 WORDS ONTO AN ONLINE COMPUTER.
Even when we do start supporting fundraiser seeds, don't use it except for
testing or with small amounts. We will release a CLI to use for offline signing
Expand All @@ -28,8 +26,7 @@ const publishRelease = ({ notes, tag, token }) =>
tag,
name: `Cosmos Voyager Alpha ${tag} (UNSAFE)`,
notes,
prerelease: true,
assets: fs.readdirSync(assetsDir).map(file => path.join(assetsDir, file))
prerelease: true
})

if (require.main === module) {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/specs/publish.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
`

const notes = `NOTE: DO NOT ENTER YOUR FUNDRAISER SEED. THIS SOFTWARE HAS NOT BEEN AUDITED.
NEVER ENTER YOUR FUNDRAISER SEED 12 WORDS ONTO AN ONLINE COMPUTER.
NEVER ENTER YOUR FUNDRAISER SEED 24 WORDS ONTO AN ONLINE COMPUTER.
Even when we do start supporting fundraiser seeds, don't use it except for
testing or with small amounts. We will release a CLI to use for offline signing
Expand Down

0 comments on commit f1809de

Please sign in to comment.