From 15e14c9f24e219be3b3f240c71142778233b215d Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 8 May 2018 15:56:02 +0700 Subject: [PATCH] Init --- .editorconfig | 12 ++++++++++++ .gitattributes | 1 + .travis.yml | 11 +++++++++++ MAINTAINING.md | 11 +++++++++++ README.md | 5 +++++ publish.sh | 22 ++++++++++++++++++++++ 6 files changed, 62 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .travis.yml create mode 100644 MAINTAINING.md create mode 100644 README.md create mode 100755 publish.sh diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..1c6314a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_style = tab +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.yml] +indent_style = space +indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c2f36a8 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +os: osx +osx_image: xcode9.3 +language: node_js +node_js: '8' +branches: + only: + - master +git: + depth: false +script: + - ./publish.sh diff --git a/MAINTAINING.md b/MAINTAINING.md new file mode 100644 index 0000000..b2c3bb5 --- /dev/null +++ b/MAINTAINING.md @@ -0,0 +1,11 @@ +# Maintaining + +Travis is set up to run once every 24 hours. The script in `.travis.yml` clones the latest `master` of HyperDEX and publishes a new nightly build. + +You can force a new build immediately with: `git commit --amend --no-edit && git push --force-with-lease`. Can be useful if it's important to get out a build right away. + +## Setup + +- Add a environment variable to Travis named `GH_TOKEN` with a [GitHub personal access token](https://github.com/settings/tokens/new) with the `public_repo` scope. +- Add a environment variable to Travis named `EP_PRE_RELEASE` to `true`. +- Add a new Travis cron job that runs every day. diff --git a/README.md b/README.md new file mode 100644 index 0000000..8cd1076 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# HyperDEX nightlies + +**This app is still in private testing phase. The repo has been made public for convenience. Please do not share it.** + +[Nightly builds for HyperDEX](https://github.com/lukechilds/hyperdex-nightlies/releases/latest) diff --git a/publish.sh b/publish.sh new file mode 100755 index 0000000..64e2c9a --- /dev/null +++ b/publish.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +brew install rpm +git clone https://github.com/lukechilds/hyperdex + +cd hyperdex/app +LATEST_COMMIT_SHA=$(git rev-parse HEAD) +LATEST_COMMIT_SHA_SHORT=$(git rev-parse --short HEAD) +npx dot-json package.json name 'hyperdex-nightly' +npx dot-json package.json productName 'HyperDEX Nightly' +npx dot-json package.json version "0.0.0-$LATEST_COMMIT_SHA_SHORT-$(echo $(npx utc-version))" + +cd .. +LATEST_NIGHTLY_TAG=$(cd .. && git describe --tags $(git rev-list --tags --max-count=1)) +NIGHTLY_HYPERDEX_COMMIT=$(git rev-parse $(echo "$LATEST_NIGHTLY_TAG" | cut -d- -f2)) +RELEASE_NOTES="Changes: https://github.com/lukechilds/hyperdex/compare/$NIGHTLY_HYPERDEX_COMMIT...$LATEST_COMMIT_SHA" +npx dot-json package.json repository 'lukechilds/hyperdex-nightlies' +npx dot-json package.json build.appId 'com.lukechilds.hyperdex-nightly' + +npm install +webpack --mode=production +electron-builder --mac --linux --win --publish=always --config.releaseInfo.releaseNotes "$RELEASE_NOTES" --config.publish.provider=github --config.publish.releaseType=release --config.publish.publishAutoUpdate=false