2017-04-29 18:39:08 +00:00
|
|
|
#!/usr/bin/env bash
|
2021-03-05 02:13:58 +00:00
|
|
|
|
2017-04-29 18:39:08 +00:00
|
|
|
# Updates the changelog and version in the package.json
|
|
|
|
# Will also create a commit with these changes locally
|
|
|
|
#
|
|
|
|
# Usage:
|
2021-05-21 22:16:59 +00:00
|
|
|
# ./.github/generate-changelog -- "7.0.0"
|
2017-04-29 18:39:08 +00:00
|
|
|
#
|
|
|
|
# Prerequisites:
|
|
|
|
# - On master branch
|
|
|
|
# - No uncommitted changes
|
|
|
|
#
|
|
|
|
# Dependencies:
|
2021-03-05 02:13:58 +00:00
|
|
|
# - git-extras: https://github.com/tj/git-extras/blob/master/Installation.md
|
|
|
|
# - jq: https://stedolan.github.io/jq/download/
|
2017-04-29 18:39:08 +00:00
|
|
|
|
|
|
|
set -eo pipefail
|
|
|
|
|
2021-06-29 02:56:53 +00:00
|
|
|
echo 'HEY YOU. Before you release, here is a report of outdated dependencies.'
|
|
|
|
echo ' - Red upgrades fulfill semver and do *not* need any action'
|
|
|
|
echo ' - Yellow upgrades *do* need looking at changelogs for breaking changes, and updating package.json'
|
|
|
|
echo
|
|
|
|
echo 'CLI:'
|
|
|
|
npm out
|
|
|
|
echo
|
|
|
|
echo 'App:'
|
|
|
|
cd app && npm out; cd ..
|
|
|
|
echo
|
|
|
|
echo 'Okay with this, or care to do/plan a few upgrades?'
|
|
|
|
echo 'Press any key to continue, or Ctrl+C to abort'
|
|
|
|
read -r
|
|
|
|
|
|
|
|
echo 'HEY YOU, again. Did you run the quick pre-release smoke test? ( npm run test:manual )'
|
2021-03-05 02:13:58 +00:00
|
|
|
echo 'Press any key to continue, or Ctrl+C to abort'
|
|
|
|
read -r
|
|
|
|
|
2017-04-29 18:39:08 +00:00
|
|
|
# Checks if we are on the master branch
|
|
|
|
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
|
|
if [[ "$BRANCH" != 'master' ]]; then
|
|
|
|
echo 'ERROR: not on master branch' >&2
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Checks if there are uncommitted changes
|
|
|
|
git diff-index --quiet HEAD -- || (echo 'ERROR: there are uncommitted changes' >&2 && exit 1)
|
|
|
|
|
|
|
|
VERSION="$1"
|
|
|
|
|
|
|
|
# Validates the $VERSION
|
|
|
|
SEMVER_REGEX='^([0-9]+\.){2}([0-9]+)$'
|
|
|
|
if ! [[ $VERSION =~ $SEMVER_REGEX ]]; then
|
|
|
|
echo "ERROR: Version '$VERSION' is invalid " >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-03-05 02:13:58 +00:00
|
|
|
# 1. Update the version in the package.json
|
2017-04-29 18:39:08 +00:00
|
|
|
cat package.json | jq ".version = \"$VERSION\"" > package.json.tmp
|
2021-03-05 02:13:58 +00:00
|
|
|
mv package.json.tmp package.json # workaround for in-place jq editing
|
2017-04-29 18:39:08 +00:00
|
|
|
|
2021-03-05 02:13:58 +00:00
|
|
|
# 2. Compile new commits from CHANGELOG.md, and open it in your EDITOR for cleanup
|
Revamp and move to TypeScript (#898)
## Breaking changes
- Require **Node >= 8.10.0 and npm 5.6.0**
- Move to **Electron 8.1.1**.
- That's it. Lots of care went into breaking CLI & programmatic behavior
as little as possible. **Please report regressions**.
- Known issue: build may fail behind a proxy. Get in touch if you use one:
https://github.com/jiahaog/nativefier/issues/907#issuecomment-596144768
## Changes summary
Nativefier didn't get much love recently, to the point that it's
becoming hard to run on recent Node, due to old dependencies.
Also, some past practices now seem weird, as better expressible
by modern JS/TS, discouraging contributions including mine.
Addressing this, and one thing leading to another, came a
bigger-than-expected revamp, aiming at making Nativefier more
**lean, stable, future-proof, user-friendly and dev-friendly**,
while **not changing the CLI/programmatic interfaces**. Highlights:
- **Require Node>=8**, as imposed by many of our dependencies. Node 8
is twice LTS, and easily available even in conservative Linux distros.
No reason not to demand it.
- **Default to Electron 8**.
- **Bump** all dependencies to latest version, including electron-packager.
- **Move to TS**. TS is great. As of today, I see no reason not to use it,
and fight interface bugs at runtime rather than at compile time.
With that, get rid of everything Babel/Webpack.
- **Move away from Gulp**. Gulp's selling point is perf via streaming,
but for small builds like Nativefier, npm tasks are plenty good
and less dependency bloat. Gulp was the driver for this PR: broken
on Node 12, and I didn't feel like just upgrading and keeping it.
- Add tons of **verbose logs** everywhere it makes sense, to have a
fine & clear trace of the program flow. This will be helpful to
debug user-reported issues, and already helped me fix a few bugs.
- With better simple logging, get rid of the quirky and buggy
progress bar based on package `progress`. Nice logging (minimal
by default, the verbose logging mentioned above is only used
when passing `--verbose`) is better and one less dependency.
- **Dump `async` package**, a relic from old callback-hell early Node.
Also dump a few other micro-packages unnecessary now.
- A first pass of code **cleanup** thanks to modern JS/TS features:
fixes, simplifications, jsdoc type annotations to types, etc.
- **Remove GitHub integrations Hound & CodeClimate**, which are more
exotic than good'ol'linters, and whose signal-to-noise ratio is too low.
- Quality: **Add tests** and add **Windows + macOS CI builds**.
Also, add a **manual test script**, helping to quickly verify the
hard-to-programatically-test stuff before releases, and limit regressions.
- **Fix a very small number of existing bugs**. The goal of this PR was
*not* to fix bugs, but to get Nativefier in better shape to do so.
Bugfixes will come later. Still, these got addressed:
- Add common `Alt`+`Left`/`Right` for previous/next navigation.
- Improve #379: fix zoom with `Ctrl` + numpad `+`/`-`
- Fix pinch-to-zoom (see https://github.com/jiahaog/nativefier/issues/379#issuecomment-598612128 )
2020-03-15 20:50:01 +00:00
|
|
|
git changelog CHANGELOG.md --tag "$VERSION"
|
2017-04-29 18:39:08 +00:00
|
|
|
|
2021-03-05 02:13:58 +00:00
|
|
|
# 3. Commit the changes
|
Revamp and move to TypeScript (#898)
## Breaking changes
- Require **Node >= 8.10.0 and npm 5.6.0**
- Move to **Electron 8.1.1**.
- That's it. Lots of care went into breaking CLI & programmatic behavior
as little as possible. **Please report regressions**.
- Known issue: build may fail behind a proxy. Get in touch if you use one:
https://github.com/jiahaog/nativefier/issues/907#issuecomment-596144768
## Changes summary
Nativefier didn't get much love recently, to the point that it's
becoming hard to run on recent Node, due to old dependencies.
Also, some past practices now seem weird, as better expressible
by modern JS/TS, discouraging contributions including mine.
Addressing this, and one thing leading to another, came a
bigger-than-expected revamp, aiming at making Nativefier more
**lean, stable, future-proof, user-friendly and dev-friendly**,
while **not changing the CLI/programmatic interfaces**. Highlights:
- **Require Node>=8**, as imposed by many of our dependencies. Node 8
is twice LTS, and easily available even in conservative Linux distros.
No reason not to demand it.
- **Default to Electron 8**.
- **Bump** all dependencies to latest version, including electron-packager.
- **Move to TS**. TS is great. As of today, I see no reason not to use it,
and fight interface bugs at runtime rather than at compile time.
With that, get rid of everything Babel/Webpack.
- **Move away from Gulp**. Gulp's selling point is perf via streaming,
but for small builds like Nativefier, npm tasks are plenty good
and less dependency bloat. Gulp was the driver for this PR: broken
on Node 12, and I didn't feel like just upgrading and keeping it.
- Add tons of **verbose logs** everywhere it makes sense, to have a
fine & clear trace of the program flow. This will be helpful to
debug user-reported issues, and already helped me fix a few bugs.
- With better simple logging, get rid of the quirky and buggy
progress bar based on package `progress`. Nice logging (minimal
by default, the verbose logging mentioned above is only used
when passing `--verbose`) is better and one less dependency.
- **Dump `async` package**, a relic from old callback-hell early Node.
Also dump a few other micro-packages unnecessary now.
- A first pass of code **cleanup** thanks to modern JS/TS features:
fixes, simplifications, jsdoc type annotations to types, etc.
- **Remove GitHub integrations Hound & CodeClimate**, which are more
exotic than good'ol'linters, and whose signal-to-noise ratio is too low.
- Quality: **Add tests** and add **Windows + macOS CI builds**.
Also, add a **manual test script**, helping to quickly verify the
hard-to-programatically-test stuff before releases, and limit regressions.
- **Fix a very small number of existing bugs**. The goal of this PR was
*not* to fix bugs, but to get Nativefier in better shape to do so.
Bugfixes will come later. Still, these got addressed:
- Add common `Alt`+`Left`/`Right` for previous/next navigation.
- Improve #379: fix zoom with `Ctrl` + numpad `+`/`-`
- Fix pinch-to-zoom (see https://github.com/jiahaog/nativefier/issues/379#issuecomment-598612128 )
2020-03-15 20:50:01 +00:00
|
|
|
git add CHANGELOG.md
|
2017-04-29 18:39:08 +00:00
|
|
|
git add package.json
|
|
|
|
git commit -m "Update changelog for \`v$VERSION\`"
|
2021-03-05 02:13:58 +00:00
|
|
|
|
|
|
|
# 4. Create an annotated tag
|
|
|
|
git tag -a "v$VERSION" -m "v$VERSION"
|
|
|
|
|
|
|
|
# 5. List remaining work
|
|
|
|
echo
|
|
|
|
echo 'Please verify commit & tag look fine in Git, then:'
|
|
|
|
echo ' 1. Push: git push --follow-tags origin master'
|
|
|
|
echo ' 2. Create a GitHub Release at https://github.com/nativefier/nativefier/releases ,'
|
|
|
|
echo " using created tag v$VERSION and with title \"Nativefier v$VERSION\" (yes, with a \"v\")."
|
|
|
|
echo
|
|
|
|
echo 'GitHub Action "publish" will react on the new release, and publish it to npm.'
|
|
|
|
echo 'The new version will be visible on npm within a few minutes/hours.'
|