Skip to content

Commit 2d03dc5

Browse files
committed
feat: partial integrate of release changes
1 parent d31e0a8 commit 2d03dc5

File tree

3 files changed

+62
-39
lines changed

3 files changed

+62
-39
lines changed

.travis.yml

Lines changed: 50 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,59 +10,78 @@ cache:
1010
directories:
1111
- node_modules
1212

13-
# Custom install step so the travis scripts don't need to be in package.json
13+
# Custom install step so the travis-only stuff doesn't need to be in package.json
1414
install:
1515
- npm install
16-
- npm install @alrra/travis-scripts@^3.0.1
16+
- npm install @alrra/travis-scripts@^3.0.1 gh-pages@^0.12.0
1717

1818
# Bundle before running tests so the bundle is always up-to-date
1919
before_script: npm run build
2020

2121
# This is the default, but leaving so it is obvious
2222
# script: npm test
2323

24-
# After a successful build create bundles & commit back to the repo
24+
# After a successful build commit changes back to repo
2525
after_success:
2626
- |
27+
# Set up SSH environment
28+
$(npm bin)/set-up-ssh \
29+
--key "$encrypted_8b86e0359d64_key" \
30+
--iv "$encrypted_8b86e0359d64_iv" \
31+
--path-encrypted-key "./.deploy.enc"
32+
33+
# Commit bundle changes generated in before_script step
34+
# --commands is a weird no-op but required for commit-changes to run
35+
# --branch arg is to ensure this only runs against the `next` branch
36+
$(npm bin)/commit-changes \
37+
--commands "echo committing" \
38+
--commit-message "Bundled output for commit $TRAVIS_COMMIT [skip ci]" \
39+
--branch "next"
2740
28-
# Only want to commit when building a push on whatever $BRANCH is
41+
# Only want to commit docs when building pushes on master &
42+
# this doesn't have the built-in branch protection like commit-changes
2943
if [ "$TRAVIS_EVENT_TYPE" == "push" ] && \
30-
[ "$TRAVIS_BRANCH" == "$BRANCH" ] && \
31-
[ "$TRAVIS_REPO_SLUG" == "$REPO" ]
44+
[ "$TRAVIS_BRANCH" == "master" ] && \
45+
[ "$TRAVIS_REPO_SLUG" == "lhorie/mithril.js" ]
3246
then
33-
# Set up SSH environment
34-
$(npm bin)/set-up-ssh \
35-
--key "$encrypted_8b86e0359d64_key" \
36-
--iv "$encrypted_8b86e0359d64_iv" \
37-
--path-encrypted-key "./.deploy.enc"
47+
# Generate docs
48+
$(npm-bin) run gendocs
3849
39-
# Commit changes (if there were any) from running build earlier
40-
$(npm bin)/commit-changes \
41-
--commands "echo committing" \
42-
--commit-message "Bundled output for commit $TRAVIS_COMMIT [skip ci]" \
43-
--branch "$BRANCH"
50+
# Commit docs to gh-pages branch
51+
# Using --add to ensure that archived versions aren't lost
52+
# Using --repo to force it to go over SSH so the saved keys are used (tschaub/gh-pages#160)
53+
$(npm bin)/gh-pages --dist ./dist --add --repo "[email protected]:lhorie/mithril.js.git"
4454
else
45-
echo "Not submitting build artifacts"
55+
echo "Not submitting documentation updates"
4656
fi
47-
57+
4858
# Environment configuration
4959
env:
5060
global:
51-
# Restrict the branch this will activate on
52-
- BRANCH=rewrite
53-
- REPO=lhorie/mithril.js
54-
5561
# Set up GH_USER_EMAIL & GH_USER_NAME env variables used by travis-scripts package
5662
- secure: Xvqvm3+PvJu/rs3jl/NNn0RWLkkLkIoPHiL0GCfVRaywgjCYVN02g54NVvIDaOfybqPmu9E6PJFVs92vhF34NMFQHf4EWskynusIGV271R2BV0i+OJBfLMuLgiwm6zRn7/Zw4JvWIUGEwcnlz0qxbqdHsS0SOR3fIkFzePickW0=
5763
- secure: Rf/ldEO9d4vItJhe6EmqWpFAyCARzoCb422nHnjr1hYJknnwIXpgyZ1C/7On/9o7rWPPf+8WcHC/rgjK2rthKCldzdG5I60LfWSNzap9lk3Aa4TpSCoDBuEp7JVvDr5tc3rKnBXVT71hOay7RSx1StWzXiJs9mjaeVMJzYzRT78=
5864

59-
# Deploy to npm on tagged commits that successfully build
65+
# Deploy to npm and github pages on tagged commits that successfully build
6066
deploy:
61-
provider: npm
62-
63-
skip_cleanup: true
64-
api_key:
65-
secure: ADElvD1oxn9GfEG7dDOggX96b36A/cGEybovAc0221CCKzv5kWCavMrtxneiJYI6N/n24abSlbM90vMfU84FEzH0Ev28dGVokRP4ad6VRkISszKlYVEP8Lds4QxfKh78jZlUxmxM0B3vmQ1kYJbTBqp3ICtaJ5ptEQHWhrLtxnc=
66-
on:
67-
tags: true
68-
repo: lhorie/mithril.js
67+
- provider: releases
68+
api_key:
69+
secure: PauFuz+pn7oRpHn2JTl4k3+iWjOofyBYBvavPQVNdXgKws9mGj0i2n5k2oIDU09VD7NeyEkwP6tdLCUFNaR8uwTJH/TBXMZE95oxUEaliFreA0nOiI3WkG4NCW0GwUoIIn1yL14y6+9oEBinWUia8DIn9kZNS11DNDgQpIPnoQQ=
70+
file:
71+
- "mithril.js"
72+
- "mithril.min.js"
73+
skip_cleanup: true
74+
on:
75+
tags: true
76+
repo: lhorie/mithril.js
77+
branch: master
78+
79+
- provider: npm
80+
skip_cleanup: true
81+
82+
api_key:
83+
secure: ADElvD1oxn9GfEG7dDOggX96b36A/cGEybovAc0221CCKzv5kWCavMrtxneiJYI6N/n24abSlbM90vMfU84FEzH0Ev28dGVokRP4ad6VRkISszKlYVEP8Lds4QxfKh78jZlUxmxM0B3vmQ1kYJbTBqp3ICtaJ5ptEQHWhrLtxnc=
84+
on:
85+
tags: true
86+
repo: lhorie/mithril.js
87+
branch: master

docs/releasing.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Releasing new builds of mithril is mostly automated via `npm version`
44

55
## Publishing to NPM
66

7-
1. `npm version <major|minor|patch|semver> -m "v%s"`
7+
1. `npm run release <major|minor|patch|semver>`
88

99
All further steps are automated and run as follows:
1010

11-
2. Tests are run
12-
3. Linting is run (but doesn't fail build)
13-
4. Version number in package.json is incremented
14-
5. New bundles are generated using updated version
11+
2. New bundles are generated using updated version
12+
3. Tests are run
13+
4. Linting is run (but doesn't fail build)
14+
5. Version number in package.json is incremented
1515
6. `git add` called on bundle output
1616
7. `package.json` and updated bundles are committed to git
1717
8. previous commit is tagged using new version number
@@ -27,7 +27,9 @@ All further steps are automated and run as follows:
2727

2828
## Publishing a GitHub release
2929

30-
**TODO**
30+
Happens automatically as part of the [Publishing to NPM](#publishing-to-npm) process described above.
31+
32+
Does require a manual description to be added though, as the auto-generated one isn't very interesting.
3133

3234
## Updating `docs/change-log.md`
3335

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mithril",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "A framework for building brilliant applications",
55
"author": "Leo Horie",
66
"license": "MIT",
@@ -14,11 +14,13 @@
1414
"lintdocs": "node docs/lint",
1515
"gendocs": "node docs/generate",
1616
"lint": "eslint .",
17+
"lint:fix": "eslint . --fix",
1718
"test": "node ospec/bin/ospec",
1819
"posttest": "npm run lint || true",
1920
"cover": "istanbul cover --print both ospec/bin/ospec",
21+
"release": "npm version -m 'v%s'",
2022
"preversion": "npm run test",
21-
"version": "npm run build && npm run gendocs && git add mithril.js mithril.min.js",
23+
"version": "npm run build && git add mithril.js mithril.min.js",
2224
"postversion": "git push --follow-tags"
2325
},
2426
"devDependencies": {

0 commit comments

Comments
 (0)