Skip to content

Commit

Permalink
Revert "Revert "single executable support""
Browse files Browse the repository at this point in the history
This reverts commit 970b2dd.
  • Loading branch information
jesec committed Nov 15, 2020
1 parent 1a878d5 commit 3fb51e2
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ config.js

# Distribution files
dist/
dist-pkg/

# Runtime files
run/
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/publish-rolling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,48 @@ jobs:
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

pkg:
runs-on: ubuntu-latest

strategy:
matrix:
node: [15]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org'

- run: npm ci --no-optional
- run: sudo npm install -g pkg

- name: Tag rolling release
run: |
npm version --no-git-tag-version 0.0.0-master.`git rev-parse --short HEAD`
- name: Build executables
run: |
npm run build-pkg
- name: 'Upload executable: Linux'
uses: actions/upload-artifact@v2
with:
name: flood-linux
path: dist-pkg/flood-linux

- name: 'Upload executable: MacOS'
uses: actions/upload-artifact@v2
with:
name: flood-macos
path: dist-pkg/flood-macos

- name: 'Upload executable: Windows'
uses: actions/upload-artifact@v2
with:
name: flood-win
path: dist-pkg/flood-win.exe
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ config.js

# Distribution files
dist/
dist-pkg/

# Runtime files
run/
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Distribution files
dist/
dist-pkg/

# Coverage reports
coverage/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Install [Node.js runtime](https://nodejs.org/). Flood tracks `Current` and provi
- Debian, Ubuntu and RHEL-based distributions users can install latest `nodejs` from [NodeSource](https://github.com/nodesource/distributions) software repository.
- Windows and MacOS users may use installer.

**EXPERIMENTAL**: You can download a single-executable rolling build of Flood from [Github Actions](https://github.com/jesec/flood/actions?query=workflow%3A%22Publish+rolling+build%22). It bundles `Node.js` and supports `Linux`, `MacOS` and `Windows`.

### Installation

`sudo npm i -g flood` or `npx flood`
Expand Down
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,24 @@
"bin": {
"flood": "dist/index.js"
},
"pkg": {
"assets": [
"dist/assets/**/*",
"dist/geoip-country.dat",
"dist/geoip-country6.dat"
],
"targets": [
"node14-linux-x64",
"node14-macos-x64",
"node14-win-x64"
]
},
"scripts": {
"build": "npm run build-assets && npm run build-ts",
"build-assets": "node client/scripts/build.js",
"build-ts": "ncc build server/bin/start.ts -m -t -e geoip-country",
"build-i18n": "formatjs compile --ast --format simple client/src/javascript/i18n/strings.json --out-file client/src/javascript/i18n/strings.compiled.json && formatjs compile-folder --ast --format simple client/src/javascript/i18n/translations client/src/javascript/i18n/compiled",
"build-pkg": "rm -rf dist && npm run build && pkg . --out-path dist-pkg",
"format-source": "prettier -w .",
"check-compiled-i18n": "npm run build-i18n && npm run format-source && git diff --quiet client/src/javascript/i18n/compiled",
"check-source-formatting": "prettier -c .",
Expand Down

0 comments on commit 3fb51e2

Please sign in to comment.