Skip to content

Commit 72e38c2

Browse files
committed
Simplify README, action and setup.js
1 parent fd4c3d0 commit 72e38c2

3 files changed

Lines changed: 9 additions & 13 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: zola-bin publish actions
1+
name: Build and publish zola-npm
22
env:
33
DEBUG: napi:*
44
APP_NAME: zola-bin
@@ -12,7 +12,7 @@ permissions:
1212
jobs:
1313
build:
1414
strategy:
15-
fail-fast: false
15+
fail-fast: true
1616
matrix:
1717
settings:
1818
- host: windows-latest
@@ -50,7 +50,6 @@ jobs:
5050
~/.cargo/registry/index/
5151
~/.cargo/registry/cache/
5252
~/.cargo/git/db/
53-
.cargo-cache
5453
zola/target/
5554
key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
5655
- name: Setup toolchain
@@ -71,6 +70,7 @@ jobs:
7170
path: ${{ matrix.settings.target }}/zola-bin.*.node
7271
if-no-files-found: error
7372
include-hidden-files: true
73+
retention-days: 3
7474
publish:
7575
name: Publish
7676
runs-on: ubuntu-latest
@@ -94,9 +94,6 @@ jobs:
9494
path: artifacts
9595
- name: Move artifacts
9696
run: npm run artifacts
97-
- name: List packages
98-
run: ls -R ./npm
99-
shell: bash
10097
- run: npm publish ./npm/win32-x64-msvc --provenance --access public
10198
env:
10299
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# zola-bin
22

33
[![npm](https://img.shields.io/npm/v/zola-bin?label=zola-bin)](https://www.npmjs.com/package/zola-bin)
4-
[![npm](https://img.shields.io/npm/v/zola-bin-linux?label=npm-zola-version)](https://www.npmjs.com/package/zola-bin-linux)
5-
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/getzola/zola?label=zola-official-latest)](https://github.com/getzola/zola/releases)
4+
[![npm](https://img.shields.io/npm/v/zola-bin-linux?label=zola-npm-built)](https://www.npmjs.com/package/@u-c-s/zola-linux-x64-gnu)
5+
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/getzola/zola?label=zola-official)](https://github.com/getzola/zola/releases)
66

77
## What is Zola ?
88

@@ -19,9 +19,7 @@ This repository provides the zola binary wrapper and the create-zola-site script
1919

2020
### Why Zola as a NPM package ??
2121

22-
> Zola provides pre-built binaries for MacOS, Linux and Windows on its [GitHub release page](https://github.com/getzola/zola/releases).
23-
24-
This package can be used for calling the pre-built `Zola` binary through [Node](https://nodejs.org), making it a part of node's vast NPM ecosystem. This package is a cross-platform, easy to install and integrate with other NPM packages. It uses the source code of Zola, to get native bindings and call them through [Node-API](https://nodejs.org/api/n-api.html).
22+
This package provides Node.js bindings for Zola, compiled directly from its source code and exposed via [Node-API](https://nodejs.org/api/n-api.html) or standard JavaScript calls. This approach ensures performance close to that of native binaries while offering the convenience of an npm package, making deployment easier across various environments due to Node.js' extensive ecosystem and support.
2523

2624
## Usage
2725

setup.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { copyFile, readFile, writeFile } from "fs/promises";
1+
import { copyFile, readFile, writeFile, rm } from "fs/promises";
22
import { parse, stringify } from "smol-toml";
33

44
copyFile("src/lib.rs", "zola/src/lib.rs");
@@ -7,6 +7,7 @@ copyFile("src/build.rs", "zola/build.rs");
77
const zolaToml = await readFile("zola/Cargo.toml", { encoding: "utf8" });
88
const zolaTomlParsed = parse(zolaToml);
99

10+
delete zolaTomlParsed["bin"];
1011
zolaTomlParsed["lib"] = {};
1112
zolaTomlParsed["lib"]["crate-type"] = ["cdylib"];
1213
zolaTomlParsed["build-dependencies"]["napi-build"] = "2.1.4";
@@ -15,9 +16,9 @@ zolaTomlParsed["dependencies"]["napi"] = {
1516
"default-features": false,
1617
features: ["napi8"],
1718
};
18-
1919
zolaTomlParsed["dependencies"]["napi-derive"] = "2.16.13";
2020

2121
let newZolaToml = stringify(zolaTomlParsed);
2222
writeFile("zola/Cargo.toml", newZolaToml, { encoding: "utf8" });
23+
rm("zola/src/main.rs", { force: true });
2324
console.log("Modified the Zola's git submodule directory files.");

0 commit comments

Comments
 (0)