Restore Windows support; fix Node.js paths
This commit is contained in:
parent
697823ab17
commit
4e691ac550
|
@ -12,16 +12,20 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [macos-latest, ubuntu-latest, windows-latest]
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
|
||||||
ARCH: linux-x86_64
|
|
||||||
MIME: application/octet-stream
|
|
||||||
EXT: ''
|
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
ARCH: macos-x86_64
|
ARCH: macos-x86_64
|
||||||
MIME: application/octet-stream
|
MIME: application/octet-stream
|
||||||
EXT: ''
|
EXT: ''
|
||||||
|
- os: ubuntu-latest
|
||||||
|
ARCH: linux-x86_64
|
||||||
|
MIME: application/octet-stream
|
||||||
|
EXT: ''
|
||||||
|
- os: windows-latest
|
||||||
|
ARCH: windows-x86_64
|
||||||
|
MIME: application/vnd.microsoft.portable-executable
|
||||||
|
EXT: '.exe'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Get version
|
- name: Get version
|
||||||
|
@ -32,27 +36,16 @@ jobs:
|
||||||
id: file
|
id: file
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo ::set-output name=FILE::${{ steps.version.outputs.VERSION }}-${{ matrix.ARCH }}${{ matrix.EXT }}
|
run: echo ::set-output name=FILE::${{ steps.version.outputs.VERSION }}-${{ matrix.ARCH }}${{ matrix.EXT }}
|
||||||
- name: Set up Rust (macOS, Linux)
|
- name: Set up Rust
|
||||||
if: runner.os != 'Windows'
|
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
profile: minimal
|
profile: minimal
|
||||||
default: true
|
default: true
|
||||||
- name: Set up Rust (Windows)
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable-gnu
|
|
||||||
profile: minimal
|
|
||||||
default: true
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: '^1.14.0'
|
go-version: '^1.14.0'
|
||||||
- name: Set up GCC (Windows)
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
run: .\.github\workflows\gcc.ps1
|
|
||||||
- name: Run prebuild steps
|
- name: Run prebuild steps
|
||||||
shell: bash
|
shell: bash
|
||||||
run: bash ./prebuild.sh
|
run: bash ./prebuild.sh
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
Invoke-WebRequest 'https://wilsonl.in/TDM-GCC-64.7z' -OutFile C:\gcc.7z
|
|
||||||
7z x C:\gcc.7z -oC:\
|
|
||||||
$oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
|
|
||||||
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value "C:\TDM-GCC-64\bin;$oldpath"
|
|
|
@ -12,37 +12,29 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [macos-latest, ubuntu-latest, windows-latest]
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
|
||||||
ARCH: linux-x86_64
|
|
||||||
FILE: 'libminify_html_java.so'
|
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
ARCH: macos-x86_64
|
ARCH: macos-x86_64
|
||||||
FILE: 'libminify_html_java.dylib'
|
FILE: 'libminify_html_java.dylib'
|
||||||
|
- os: ubuntu-latest
|
||||||
|
ARCH: linux-x86_64
|
||||||
|
FILE: 'libminify_html_java.so'
|
||||||
|
- os: windows-latest
|
||||||
|
ARCH: windows-x86_64
|
||||||
|
FILE: 'hyperbuild_java.dll'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Set up Rust (macOS, Linux)
|
- name: Set up Rust
|
||||||
if: runner.os != 'Windows'
|
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
profile: minimal
|
profile: minimal
|
||||||
default: true
|
default: true
|
||||||
- name: Set up Rust (Windows)
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable-gnu
|
|
||||||
profile: minimal
|
|
||||||
default: true
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: '^1.14.0'
|
go-version: '^1.14.0'
|
||||||
- name: Set up GCC (Windows)
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
run: .\.github\workflows\gcc.ps1
|
|
||||||
- name: Run prebuild steps
|
- name: Run prebuild steps
|
||||||
shell: bash
|
shell: bash
|
||||||
run: bash ./prebuild.sh
|
run: bash ./prebuild.sh
|
||||||
|
@ -59,22 +51,32 @@ jobs:
|
||||||
needs: build
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: '1.7'
|
java-version: '1.7'
|
||||||
java-package: jdk
|
java-package: jdk
|
||||||
architecture: x64
|
architecture: x64
|
||||||
|
|
||||||
- name: Download Linux built library
|
- name: Download Linux built library
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: linux-x86_64
|
name: linux-x86_64
|
||||||
path: java/src/main/resources/linux-x86_64
|
path: java/src/main/resources/linux-x86_64
|
||||||
|
|
||||||
- name: Download macOS built library
|
- name: Download macOS built library
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: macos-x86_64
|
name: macos-x86_64
|
||||||
path: java/src/main/resources/macos-x86_64
|
path: java/src/main/resources/macos-x86_64
|
||||||
|
|
||||||
|
- name: Download Windows built library
|
||||||
|
uses: actions/download-artifact@v1
|
||||||
|
with:
|
||||||
|
name: windows-x86_64
|
||||||
|
path: java/src/main/resources/windows-x86_64
|
||||||
|
|
||||||
- name: Move native library files to correct location
|
- name: Move native library files to correct location
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ./java/src/main/resources
|
working-directory: ./java/src/main/resources
|
||||||
|
@ -83,6 +85,7 @@ jobs:
|
||||||
mv $f/* "$f.nativelib"
|
mv $f/* "$f.nativelib"
|
||||||
rmdir "$f"
|
rmdir "$f"
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Build, pack, and publish JAR
|
- name: Build, pack, and publish JAR
|
||||||
working-directory: ./java
|
working-directory: ./java
|
||||||
env:
|
env:
|
||||||
|
|
|
@ -12,13 +12,15 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [macos-latest, ubuntu-latest, windows-latest]
|
||||||
node: [8, 9, 10, 11, 12, 13, 14]
|
node: [8, 9, 10, 11, 12, 13, 14]
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
|
||||||
ARCH: linux-x86_64
|
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
ARCH: macos-x86_64
|
ARCH: macos-x86_64
|
||||||
|
- os: ubuntu-latest
|
||||||
|
ARCH: linux-x86_64
|
||||||
|
- os: windows-latest
|
||||||
|
ARCH: windows-x86_64
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Get version
|
- name: Get version
|
||||||
|
@ -29,27 +31,16 @@ jobs:
|
||||||
uses: actions/setup-node@master
|
uses: actions/setup-node@master
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}.x
|
node-version: ${{ matrix.node }}.x
|
||||||
- name: Set up Rust (macOS, Linux)
|
- name: Set up Rust
|
||||||
if: runner.os != 'Windows'
|
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
profile: minimal
|
profile: minimal
|
||||||
default: true
|
default: true
|
||||||
- name: Set up Rust (Windows)
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable-gnu
|
|
||||||
profile: minimal
|
|
||||||
default: true
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: '^1.14.0'
|
go-version: '^1.14.0'
|
||||||
- name: Set up GCC (Windows)
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
run: .\.github\workflows\gcc.ps1
|
|
||||||
- name: Run prebuild steps
|
- name: Run prebuild steps
|
||||||
shell: bash
|
shell: bash
|
||||||
run: bash ./prebuild.sh
|
run: bash ./prebuild.sh
|
||||||
|
@ -58,7 +49,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
npm install
|
npm install
|
||||||
npm run build-binary
|
npm run build
|
||||||
node compress.js
|
node compress.js
|
||||||
- name: Install B2 CLI (macOS, Linux)
|
- name: Install B2 CLI (macOS, Linux)
|
||||||
if: runner.os != 'Windows'
|
if: runner.os != 'Windows'
|
||||||
|
@ -74,7 +65,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
binary_name="$(node -e 'console.log([process.platform, process.arch, process.versions.modules].join("__"))')"
|
binary_name="$(node -e 'console.log([process.platform, process.arch, process.versions.modules].join("__"))')"
|
||||||
b2 authorize-account ${{ secrets.CICD_CLI_B2_KEY_ID }} ${{ secrets.CICD_CLI_B2_APPLICATION_KEY }}
|
b2 authorize-account ${{ secrets.CICD_CLI_B2_KEY_ID }} ${{ secrets.CICD_CLI_B2_APPLICATION_KEY }}
|
||||||
b2 upload-file ${{ secrets.CICD_CLI_B2_BUCKET_NAME }} ./nodejs/dist/index.node.gz "minify-html/bin/nodejs/${{ steps.version.outputs.VERSION }}/$binary_name.node.gz"
|
b2 upload-file ${{ secrets.CICD_CLI_B2_BUCKET_NAME }} ./nodejs/index.node.gz "minify-html/bin/nodejs/${{ steps.version.outputs.VERSION }}/$binary_name.node.gz"
|
||||||
package:
|
package:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
|
|
|
@ -12,7 +12,7 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [macos-latest, ubuntu-latest, windows-latest]
|
||||||
python: [3.5, 3.6, 3.7, 3.8]
|
python: [3.5, 3.6, 3.7, 3.8]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
@ -22,31 +22,18 @@ jobs:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
architecture: 'x64'
|
architecture: 'x64'
|
||||||
|
|
||||||
- name: Set up Rust (macOS, Linux)
|
- name: Set up Rust
|
||||||
if: runner.os != 'Windows'
|
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
profile: minimal
|
profile: minimal
|
||||||
default: true
|
default: true
|
||||||
|
|
||||||
- name: Set up Rust (Windows)
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable-gnu
|
|
||||||
profile: minimal
|
|
||||||
default: true
|
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: '^1.14.0'
|
go-version: '^1.14.0'
|
||||||
|
|
||||||
- name: Set up GCC (Windows)
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
run: .\.github\workflows\gcc.ps1
|
|
||||||
|
|
||||||
- name: Run prebuild steps
|
- name: Run prebuild steps
|
||||||
shell: bash
|
shell: bash
|
||||||
run: bash ./prebuild.sh
|
run: bash ./prebuild.sh
|
||||||
|
|
13
README.md
13
README.md
|
@ -17,12 +17,13 @@ Comparison with [html-minfier](https://github.com/kangax/html-minifier) and [min
|
||||||
|
|
||||||
### CLI
|
### CLI
|
||||||
|
|
||||||
Precompiled binaries are available for x86-64 macOS and Linux.
|
Precompiled binaries are available for x86-64 Linux, macOS, and Windows.
|
||||||
|
|
||||||
##### Get
|
##### Get
|
||||||
|
|
||||||
|
[Linux](https://wilsonl.in/minify-html/bin/0.2.6-linux-x86_64) |
|
||||||
[macOS](https://wilsonl.in/minify-html/bin/0.2.6-macos-x86_64) |
|
[macOS](https://wilsonl.in/minify-html/bin/0.2.6-macos-x86_64) |
|
||||||
[Linux](https://wilsonl.in/minify-html/bin/0.2.6-linux-x86_64)
|
[Windows](https://wilsonl.in/minify-html/bin/0.2.6-windows-x86_64)
|
||||||
|
|
||||||
##### Use
|
##### Use
|
||||||
|
|
||||||
|
@ -101,7 +102,7 @@ fn main() {
|
||||||
|
|
||||||
- Package: [@minify-html/js](https://www.npmjs.com/package/@minify-html/js)
|
- Package: [@minify-html/js](https://www.npmjs.com/package/@minify-html/js)
|
||||||
- Binding: [Neon](https://neon-bindings.com/)
|
- Binding: [Neon](https://neon-bindings.com/)
|
||||||
- Platforms: macOS, Linux; Node.js 8 and higher
|
- Platforms: Linux, macOS, Windows; Node.js 8 and higher
|
||||||
|
|
||||||
##### Get
|
##### Get
|
||||||
|
|
||||||
|
@ -150,7 +151,7 @@ const minified = minifyHtml.minifyInPlace(fs.readFileSync("source.html"), cfg);
|
||||||
|
|
||||||
- Package: [in.wilsonl.minifyhtml](https://search.maven.org/artifact/in.wilsonl.minifyhtml/minify-html)
|
- Package: [in.wilsonl.minifyhtml](https://search.maven.org/artifact/in.wilsonl.minifyhtml/minify-html)
|
||||||
- Binding: [JNI](https://github.com/jni-rs/jni-rs)
|
- Binding: [JNI](https://github.com/jni-rs/jni-rs)
|
||||||
- Platforms: macOS, Linux; Java 7 and higher
|
- Platforms: Linux, macOS, Windows; Java 7 and higher
|
||||||
|
|
||||||
##### Get
|
##### Get
|
||||||
|
|
||||||
|
@ -190,7 +191,7 @@ MinifyHtml.minifyInPlace(source, cfg);
|
||||||
|
|
||||||
- Package: [minify-html](https://pypi.org/project/minify-html)
|
- Package: [minify-html](https://pypi.org/project/minify-html)
|
||||||
- Binding: [PyO3](https://github.com/PyO3/pyo3)
|
- Binding: [PyO3](https://github.com/PyO3/pyo3)
|
||||||
- Platforms: macOS, Linux; Python 3.5 and higher
|
- Platforms: Linux, macOS, Windows; Python 3.5 and higher
|
||||||
|
|
||||||
##### Get
|
##### Get
|
||||||
|
|
||||||
|
@ -214,7 +215,7 @@ except SyntaxError as e:
|
||||||
|
|
||||||
- Package: [minify_html](https://rubygems.org/gems/minify_html)
|
- Package: [minify_html](https://rubygems.org/gems/minify_html)
|
||||||
- Binding: [Rutie](https://github.com/danielpclark/rutie)
|
- Binding: [Rutie](https://github.com/danielpclark/rutie)
|
||||||
- Platforms: macOS, Linux; Ruby 2.5 and higher
|
- Platforms: Linux, macOS; Ruby 2.5 and higher
|
||||||
|
|
||||||
##### Get
|
##### Get
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ pushd "$(dirname "$0")"
|
||||||
|
|
||||||
pushd ../nodejs
|
pushd ../nodejs
|
||||||
npm run build
|
npm run build
|
||||||
npm run build-binary
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd minify-html-bench
|
pushd minify-html-bench
|
||||||
|
|
|
@ -2,6 +2,6 @@ const {readFileSync, writeFileSync} = require('fs');
|
||||||
const {join} = require('path');
|
const {join} = require('path');
|
||||||
const {gzipSync} = require('zlib');
|
const {gzipSync} = require('zlib');
|
||||||
|
|
||||||
const src = readFileSync(join(__dirname, 'dist', 'index.node'));
|
const src = readFileSync(join(__dirname, 'index.node'));
|
||||||
const out = gzipSync(src);
|
const out = gzipSync(src);
|
||||||
writeFileSync(join(__dirname, 'dist', 'index.node.gz'), out);
|
writeFileSync(join(__dirname, 'index.node.gz'), out);
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
"name": "@minify-html/js",
|
"name": "@minify-html/js",
|
||||||
"version": "0.2.6",
|
"version": "0.2.6",
|
||||||
"description": "Fast and smart HTML + JS minifier",
|
"description": "Fast and smart HTML + JS minifier",
|
||||||
"main": "dist/index.node",
|
"main": "index.node",
|
||||||
"files": [
|
"files": [
|
||||||
"postinstall.js"
|
"postinstall.js"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "neon build --release && mkdir -p dist && mv native/index.node dist/index.node",
|
"build": "neon build --release && mv native/index.node index.node",
|
||||||
"postinstall": "node postinstall.js"
|
"postinstall": "node postinstall.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
@ -7,7 +7,7 @@ const pkg = require('./package.json');
|
||||||
const MAX_DOWNLOAD_ATTEMPTS = 4;
|
const MAX_DOWNLOAD_ATTEMPTS = 4;
|
||||||
|
|
||||||
const binaryName = [process.platform, process.arch, process.versions.modules].join('__');
|
const binaryName = [process.platform, process.arch, process.versions.modules].join('__');
|
||||||
const binaryPath = path.join(__dirname, 'dist', 'index.node');
|
const binaryPath = path.join(__dirname, 'index.node');
|
||||||
|
|
||||||
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
|
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue