Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto release: Creating PR overnight #1972

Merged
merged 5 commits into from
Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 yarn@1.13.0

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 "voyager_bot@tendermint.com"
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