File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030 with :
3131 node-version : ' 18.x'
3232 registry-url : ' https://registry.npmjs.org'
33-
33+
3434 - name : Test building of npm files
35- run : deno task npm 0.0.0
35+ run : deno task npm
Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ name: Release
22
33on :
44 push :
5- tags :
6- - ' *'
5+ branches :
6+ - master
7+ paths :
8+ - ' version.ts'
79
810jobs :
911 release :
@@ -27,23 +29,24 @@ jobs:
2729 env :
2830 SERPAPI_TEST_KEY : ${{ secrets.SERPAPI_TEST_KEY }}
2931 run : deno task test:ci
30-
31- - name : Get tag version
32- if : startsWith(github.ref, 'refs/tags/')
33- id : get_tag_version
34- run : echo "TAG_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
35-
32+
3633 - name : Setup Node
3734 uses : actions/setup-node@v3
3835 with :
3936 node-version : ' 18.x'
4037 registry-url : ' https://registry.npmjs.org'
41-
38+
4239 - name : Build npm files
43- run : deno task npm ${{ steps.get_tag_version.outputs.TAG_VERSION }}
44-
40+ run : deno task npm
41+
42+ - name : Push tag
43+ run : |
44+ VERSION=$(cat version.ts | sed -n 's/.*"\(.*\)".*/\1/p')
45+ echo $VERSION
46+ git tag $VERSION
47+ git push origin $VERSION
48+
4549 - name : npm publish
46- if : startsWith(github.ref, 'refs/tags/')
4750 env :
4851 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
4952 run : cd npm && npm publish
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ and this project adheres to
1414
1515### Changed
1616
17+ - Update deploy flow to be triggered by a change in ` version.ts ` .
18+
1719### Fixed
1820
1921### Removed
Original file line number Diff line number Diff line change @@ -96,11 +96,11 @@ SerpApi project members will then review the request.
9696
9797## Release new versions
9898
99- 1 . Update changelog
99+ 1 . Update changelog.
1001002 . Merge the associated PR and ensure the "Build" workflow succeeds.
101- 3 . Push a new tag based on [ semantic versioning] ( https://semver.org/ ) , e.g.
101+ 3 . Update ` version.ts ` based on [ semantic versioning] ( https://semver.org/ ) , e.g.
102102 ` 1.2.0 ` .
103- 4 . Once the "Release" workflow succeeds, verify the new versions on npm and
104- deno.land/x.
103+ 4 . Push ` version.ts ` . This triggers the "Release" workflow.
104+ 5 . Verify that new versions have been released on npm and deno.land/x.
105105
106106[ ^ 1 ] : https://deno.land/manual/references/vscode_deno
Original file line number Diff line number Diff line change 11import { build , emptyDir } from "https://deno.land/x/dnt@0.32.0/mod.ts" ;
2+ import { version } from "../version.ts" ;
23
34await emptyDir ( "./npm" ) ;
45
5- const version = Deno . args [ 0 ] ;
6- if ( ! version ) {
7- throw new Error (
8- "Specify a version as the first argument, e.g. `deno task npm 0.0.1`" ,
9- ) ;
10- }
11-
126await build ( {
137 entryPoints : [ "./mod.ts" ] ,
148 outDir : "./npm" ,
You can’t perform that action at this time.
0 commit comments