From b31f65a98314ddadf30e5f0cc7f9f2594272377d Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sat, 3 Feb 2024 19:30:17 -0500 Subject: [PATCH] Add CI. --- .github/workflows/ci.yml | 16 ++++++++++++++++ scripts/build_npm.ts | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f05a121..0f7b1bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,3 +33,19 @@ jobs: - name: test run: deno test -A + + - name: Get tag version + if: startsWith(github.ref, 'refs/tags/') + id: get_tag_version + run: echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT + - uses: actions/setup-node@v3 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + - name: npm build + run: deno run -A ./scripts/build_npm.ts ${{steps.get_tag_version.outputs.TAG_VERSION}} + - name: npm publish + if: startsWith(github.ref, 'refs/tags/') + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: cd npm && npm publish diff --git a/scripts/build_npm.ts b/scripts/build_npm.ts index 5bdba22..5def977 100644 --- a/scripts/build_npm.ts +++ b/scripts/build_npm.ts @@ -45,7 +45,7 @@ await build({ "./src/test/server.deno.ts": "./src/test/server.node.ts", }, package: { - name: "", + name: "dax-sh", version: Deno.args[0], description: "Cross platform shell tools inspired by zx.", license: "MIT",