From 1fb870855920322987c7ce2c5c515132a42a6575 Mon Sep 17 00:00:00 2001 From: Theo Sanderson Date: Fri, 24 Nov 2023 15:32:20 +0000 Subject: [PATCH] Create release_npm.yml --- .github/workflows/release_npm.yml | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/release_npm.yml diff --git a/.github/workflows/release_npm.yml b/.github/workflows/release_npm.yml new file mode 100644 index 0000000..4348853 --- /dev/null +++ b/.github/workflows/release_npm.yml @@ -0,0 +1,35 @@ +name: Release Gensplore Component + +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: 18 + + - name: Install jq + run: sudo apt-get install jq + + - name: Update package version and release + run: | + cd taxonium_component + TAG_NAME=${GITHUB_REF#refs/tags/} + echo "Current tag is $TAG_NAME" + jq ".version = \"$TAG_NAME\"" package.json > package.json.tmp && mv package.json.tmp package.json + yarn install + yarn build + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc + npm publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_OPTIONS: --max-old-space-size=4096