8000 Release v0.0.1 · stdlib-js/array-nans@7740140 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7740140

Browse files
committed
Release v0.0.1
1 parent 45d1499 commit 7740140

File tree

5 files changed

+26
-7
lines changed

5 files changed

+26
-7
lines changed

.github/workflows/productionize.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,11 @@ jobs:
100100
# Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency:
101101
- name: 'Update dependencies in package.json'
102102
run: |
103+
PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version)
103104
if grep -q '"@stdlib/string-format"' package.json; then
104-
sed -i "s/\"@stdlib\/string-format\"/\"@stdlib\/error-tools-fmtprodmsg\"/g" package.json
105+
sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json
105106
else
106-
node -e "var pkg = require( './package.json' ); pkg.dependencies[ '@stdlib/error-tools-fmtprodmsg' ] = '^0.0.x'; require( 'fs' ).writeFileSync( 'package.json', JSON.stringify( pkg, null, 2 ) );"
107+
node -e "var pkg = require( './package.json' ); pkg.dependencies[ '@stdlib/error-tools-fmtprodmsg' ] = '^$PKG_VERSION'; require( 'fs' ).writeFileSync( 'package.json', JSON.stringify( pkg, null, 2 ) );"
107108
fi
108109
109110
# Configure git:

.github/workflows/publish.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ jobs:
105105
- name: 'Remove CLI'
106106
if: ${{ github.ref == 'refs/heads/main' }}
107107
run: |
108+
# Exit if the package does not have a CLI:
109+
if ! grep -q '"bin":' package.json; then
110+
exit 0
111+
fi
108112
rm -rf ./bin/cli
109113
rm test/test.cli.js
110114
rm etc/cli_opts.json
@@ -113,7 +117,7 @@ jobs:
113117
# For all dependencies, check in all *.js files if they are still used; if not, remove them:
114118
jq -r '.dependencies | keys[]' ./package.json | while read -r dep; do
115119
dep=$(echo "$dep" | xargs)
116-
if ! grep -q "$dep" lib/**; then
120+
if ! grep -q "$dep" lib/** && ! grep -q -s "$dep" manifest.json && ! grep -q -s "$dep" include.gypi; then
117121
jq --indent 2 "del(.dependencies[\"$dep\"])" ./package.json > ./package.json.tmp
118122
mv ./package.json.tmp ./package.json
119123
fi
@@ -123,7 +127,7 @@ jobs:
123127
continue
124128
fi
125129
dep=$(echo "$dep" | xargs)
126-
if ! grep -q "$dep" ./lib/**; then
130+
if ! grep -q "$dep" lib/** && ! grep -q -s "$dep" manifest.json && ! grep -q -s "$dep" include.gypi; then
127131
jq --indent 2 "del(.devDependencies[\"$dep\"])" ./package.json > ./package.json.tmp
128132
mv ./package.json.tmp ./package.json
129133
fi
@@ -136,6 +140,15 @@ jobs:
136140
jq -r 'del(.bin)' package.json > package.json.tmp
137141
mv package.json.tmp package.json
138142
143+
# Add entry for CLI package to See Also section of README.md:
144+
cliPkgName=$(jq -r '.name' package.json)-cli
145+
escapedPkg=$(echo "$cliPkgName" | sed -e 's/\//\\\//g')
146+
escapedPkg=$(echo "$escapedPkg" | sed -e 's/\@/\\\@/g')
147+
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/<section class=\"related\">(?:\n\n\* \* \*\n\n## See Also\n\n)?/<section class=\"related\">\n\n## See Also\n\n- <span class=\"package-name\">[\`$escapedPkg\`][$escapedPkg]<\/span><span class=\"delimiter\">: <\/span><span class=\"description\">CLI package for use as a command-line utility.<\/span>\n/"
148+
149+
# Add link definition for CLI package to README.md:
150+
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/<section class=\"links\">/<section class=\"links\">\n\n[$escapedPkg]: https:\/\/www.npmjs.com\/package\/$escapedPkg/"
151+
139152
# Replace GitHub links to individual packages with npm links:
140153
- name: 'Replace all GitHub links to individual packages with npm links'
141154
run: |

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ on:
3232
# Run workflow on each push to the main branch:
3333
push:
3434

35+
# Run workflow upon completion of `publish` workflow run:
36+
workflow_run:
37+
workflows: ["publish"]
38+
types: [completed]
39+
3540
# Workflow jobs:
3641
jobs:
3742

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
183183
[npm-image]: http://img.shields.io/npm/v/@stdlib/array-nans.svg
184184
[npm-url]: https://npmjs.org/package/@stdlib/array-nans
185185

186-
[test-image]: https://github.com/stdlib-js/array-nans/actions/workflows/test.yml/badge.svg?branch=main
187-
[test-url]: https://github.com/stdlib-js/array-nans/actions/workflows/test.yml?query=branch:main
186+
[test-image]: https://github.com/stdlib-js/array-nans/actions/workflows/test.yml/badge.svg?branch=v0.0.1
187+
[test-url]: https://github.com/stdlib-js/array-nans/actions/workflows/test.yml?query=branch:v0.0.1
188188

189189
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-nans/main.svg
190190
[coverage-url]: https://codecov.io/github/stdlib-js/array-nans?branch=main

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stdlib/array-nans",
3-
"version": "0.0.0",
3+
"version": "0.0.1",
44
"description": "Create an array filled with NaNs and having a specified length.",
55
"license": "Apache-2.0",
66
"author": {

0 commit comments

Comments
 (0)
0