-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically publish PRs from non-forks
Collaborators can get a published npm package, as a treat.
- Loading branch information
1 parent
143bbca
commit b73308b
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import childProcess from "node:child_process" | ||
import fs from "node:fs" | ||
|
||
const shortCommit = childProcess.execSync("git rev-parse --short HEAD", { encoding: "utf8" }).trim() | ||
|
||
const version = `0.0.0-${shortCommit}` | ||
|
||
console.log(`Publishing ${version} to npm...`) | ||
|
||
const packageJson = JSON.parse(fs.readFileSync("package.json", "utf8")) | ||
packageJson.version = version | ||
fs.writeFileSync("package.json", JSON.stringify(packageJson, null, 2)) | ||
|
||
childProcess.execSync("npm publish --access public --tag experimental", { stdio: "inherit" }) |