From cdfc2ae5a82ba812b82ba8b54323fde699e1fe72 Mon Sep 17 00:00:00 2001 From: Tyler Arehart Date: Sun, 10 Dec 2023 15:30:39 -0800 Subject: [PATCH] Setting up npm publishing. --- .github/workflows/nodejs.yml | 7 +++++-- .github/workflows/publish.yml | 21 +++++++++++++++++++++ package.json | 13 +++++++------ 3 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index d495fd7..1df92cd 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -7,8 +7,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: volta-cli/action@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' - run: npm ci --no-audit - run: npm run lint --if-present - run: npm test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..f3e2c9e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,21 @@ +name: Publish Package to npmjs +on: + release: + types: [published] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v3 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + - run: npm ci --no-audit + - run: npm run lint --if-present + - run: npm test + - run: npm run build:release + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 80c4bc9..5f86156 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,14 @@ { - "name": "node-typescript-boilerplate", - "version": "0.0.0", + "name": "aws-appconfig-poller", + "version": "0.0.2", "description": "A wrapper around @aws-sdk/client-appconfigdata to provide background polling and caching.", + "repository": { + "type": "git", + "url": "https://github.com/tarehart/aws-appconfig-poller.git" + }, "type": "module", "engines": { - "node": ">= 18.12 <19" + "node": ">= 18.12 <21" }, "devDependencies": { "@aws-sdk/credential-providers": "^3.470.0", @@ -41,8 +45,5 @@ "dependencies": { "@aws-sdk/client-appconfigdata": "^3.470.0", "tslib": "~2.6" - }, - "volta": { - "node": "18.12.1" } }