| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent aebb49e commit 5bff136
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,6 +30,6 @@ jobs: | |||
| 30 | 30 | with: | |
| 31 | 31 | node-version: '18.x' | |
| 32 | 32 | registry-url: 'https://registry.npmjs.org' | |
| 33 | - | ||
| 33 | + | ||
| 34 | 34 | - 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 | |||
| 2 | 2 | ||
| 3 | 3 | on: | |
| 4 | 4 | push: | |
| 5 | - tags: | ||
| 6 | - - '*' | ||
| 5 | + branches: | ||
| 6 | + - master | ||
| 7 | + paths: | ||
| 8 | + - 'version.ts' | ||
| 7 | 9 | ||
| 8 | 10 | jobs: | |
| 9 | 11 | release: | |
@@ -27,23 +29,24 @@ jobs: | |||
| 27 | 29 | env: | |
| 28 | 30 | SERPAPI_TEST_KEY: ${{ secrets.SERPAPI_TEST_KEY }} | |
| 29 | 31 | 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 | + | ||
| 36 | 33 | - name: Setup Node | |
| 37 | 34 | uses: actions/setup-node@v3 | |
| 38 | 35 | with: | |
| 39 | 36 | node-version: '18.x' | |
| 40 | 37 | registry-url: 'https://registry.npmjs.org' | |
| 41 | - | ||
| 38 | + | ||
| 42 | 39 | - 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 | + | ||
| 45 | 49 | - name: npm publish | |
| 46 | - if: startsWith(github.ref, 'refs/tags/') | ||
| 47 | 50 | env: | |
| 48 | 51 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| 49 | 52 | run: cd npm && npm publish | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,6 +14,8 @@ and this project adheres to | |||
| 14 | 14 | ||
| 15 | 15 | ### Changed | |
| 16 | 16 | ||
| 17 | + - Update deploy flow to be triggered by a change in `version.ts`. | ||
| 18 | + | ||
| 17 | 19 | ### Fixed | |
| 18 | 20 | ||
| 19 | 21 | ### Removed | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -96,11 +96,11 @@ SerpApi project members will then review the request. | |||
| 96 | 96 | ||
| 97 | 97 | ## Release new versions | |
| 98 | 98 | ||
| 99 | - 1. Update changelog | ||
| 99 | + 1. Update changelog. | ||
| 100 | 100 | 2. 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. | ||
| 102 | 102 | `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. | ||
| 105 | 105 | ||
| 106 | 106 | [^1]: https://deno.land/manual/references/vscode_deno | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,14 +1,8 @@ | |||
| 1 | 1 | import { build, emptyDir } from "https://deno.land/x/dnt@0.32.0/mod.ts"; | |
| 2 | + import { version } from "../version.ts"; | ||
| 2 | 3 | ||
| 3 | 4 | await emptyDir("./npm"); | |
| 4 | 5 | ||
| 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 | - | ||
| 12 | 6 | await build({ | |
| 13 | 7 | entryPoints: ["./mod.ts"], | |
| 14 | 8 | outDir: "./npm", | |
| Back | FazBrowse Home | New Git URL |
0 commit comments