File tree 7 files changed +3389
-141
lines changed
algoliasearch-client-javascript
7 files changed +3389
-141
lines changed Original file line number Diff line number Diff line change
1
+ //registry.npmjs.org/:_authToken = ${ NPM_AUTH_TOKEN }
Original file line number Diff line number Diff line change
1
+ name : Release packages
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - next
7
+
8
+ jobs :
9
+ release :
10
+ name : Publish
11
+ runs-on : ubuntu-20.04
12
+ if : " startsWith(github.event.issue.title, 'chore: release v')"
13
+ steps :
14
+ - uses : actions/checkout@v2
15
+ with :
16
+ fetch-depth : 0
17
+
18
+ - name : Install Node
19
+ uses : actions/setup-node@v2
20
+ with :
21
+ node-version-file : .nvmrc
22
+ cache : yarn
23
+
24
+ - name : Install JavaScript dependencies
25
+ shell : bash
26
+ run : yarn install
27
+
28
+ - name : Build clients
29
+ shell : bash
30
+ run : yarn build
31
+
32
+ - name : Publish to NPM
33
+ shell : bash
34
+ run : yarn release:publish
35
+ env :
36
+ NPM_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN }}
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change
1
+ import fsp from 'fs/promises' ;
2
+ import path from 'path' ;
3
+
4
+ import { execaCommand } from 'execa' ;
5
+ import semver from 'semver' ;
6
+
7
+ async function publish ( ) : Promise < void > {
8
+ // Read the local version of `algoliasearch/package.json`
9
+ const { version } = JSON . parse (
10
+ (
11
+ await fsp . readFile (
12
+ path . resolve (
13
+ __dirname ,
14
+ '..' ,
15
+ 'packages' ,
16
+ 'algoliasearch' ,
17
+ 'package.json'
18
+ )
19
+ )
20
+ ) . toString ( )
21
+ ) ;
22
+
23
+ // Get tag like `alpha`, `beta`, ...
24
+ const tag = semver . prerelease ( version ) ?. [ 0 ] ;
25
+
26
+ await execaCommand (
27
+ `lerna exec --no-bail npm publish --access public ${
28
+ tag ? `--tag ${ tag } ` : ''
29
+ } `,
30
+ {
31
+ shell : 'bash' ,
32
+ }
33
+ ) ;
34
+ }
35
+
36
+ publish ( ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "packages" : [" packages/*" ],
3
+ "version" : " independent"
4
+ }
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " algoliasearch-client-javascript" ,
3
- "version" : " 5.0.0" ,
4
3
"workspaces" : [
5
4
" packages/*"
6
5
],
13
12
"release" : " shipjs prepare" ,
14
13
"test:size" : " bundlesize" ,
15
14
"test:lint" : " eslint . --ext .js,.ts" ,
16
- "test:types" : " yarn tsc --noEmit"
15
+ "test:types" : " yarn tsc --noEmit" ,
16
+ "release:bump" : " lerna version ${0:-patch} --no-changelog --no-git-tag-version --no-push --yes" ,
17
+ "release:publish" : " ts-node scripts/publish.ts"
17
18
},
18
19
"devDependencies" : {
19
20
"@babel/core" : " 7.17.2" ,
25
26
"@rollup/plugin-node-resolve" : " 13.1.3" ,
26
27
"@types/rollup-plugin-node-globals" : " 1.4.1" ,
27
28
"bundlesize2" : " 0.0.31" ,
29
+ "execa" : " 6.1.0" ,
30
+ "lerna" : " 4.0.0" ,
28
31
"rollup" : " 2.67.1" ,
29
32
"rollup-plugin-filesize" : " 9.1.2" ,
30
33
"rollup-plugin-node-globals" : " 1.4.0" ,
31
34
"rollup-plugin-terser" : " 7.0.2" ,
32
35
"rollup-plugin-typescript2" : " 0.31.2" ,
36
+ "semver" : " 7.3.5" ,
37
+ "ts-node" : " 10.7.0" ,
33
38
"typescript" : " 4.5.4"
34
39
},
35
40
"engines" : {
You can’t perform that action at this time.
0 commit comments