From c0a65a2179ded2027089daaab98d3e0b5f88c8b5 Mon Sep 17 00:00:00 2001 From: "Kribl, Dennis" Date: Mon, 7 Sep 2020 12:56:06 +0200 Subject: [PATCH] build(package): add github workflow to release npm package + lint this addresses #2 --- .github/workflows/release-npm.yml | 20 ++++++++++++++++++++ package.json | 8 ++++++-- packages/cli/package.json | 1 + packages/cli/src/extensions/aws-extension.ts | 4 ++-- 4 files changed, 29 insertions(+), 4 deletions(-) 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..cdc018e --- /dev/null +++ b/.github/workflows/release-npm.yml @@ -0,0 +1,20 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: yarn install + - run: yarn build:cli + - run: yarn publish:cli --access=public --new-version=${{ github.event.release.tag_name }} + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/package.json b/package.json index 7b8ed1f..ee4539e 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,14 @@ ], "scripts": { "cli": "yarn workspace @immowelt/aws-swiss-knife run start", - "build:cli": "yarn workspace @immowelt/aws-swiss-knife build" + "build:cli": "yarn workspace @immowelt/aws-swiss-knife build", + "publish:cli": "yarn workspace @immowelt/aws-swiss-knife publish" }, "version": "1.0.0", "main": "index.js", - "author": "Matthias Rohmer ", + "author": { + "name": "Immowelt AG", + "email": "support@immowelt.de" + }, "license": "MIT" } diff --git a/packages/cli/package.json b/packages/cli/package.json index cb043b8..8e0b942 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,7 @@ { "name": "@immowelt/aws-swiss-knife", "version": "1.0.0", + "private": false, "types": "build/types/types.d.ts", "bin": { "awsk": "bin/cli" diff --git a/packages/cli/src/extensions/aws-extension.ts b/packages/cli/src/extensions/aws-extension.ts index cc32ef6..7c67684 100644 --- a/packages/cli/src/extensions/aws-extension.ts +++ b/packages/cli/src/extensions/aws-extension.ts @@ -230,9 +230,9 @@ const createChain = ( const readAvailableProfiles = (): string[] => { // read from default credentials file - const credentials = Object.keys(new IniLoader().loadFrom({isConfig: false})) + const credentials = Object.keys(new IniLoader().loadFrom({ isConfig: false })) // read from default config file - const config = Object.keys(new IniLoader().loadFrom({isConfig: true})) + const config = Object.keys(new IniLoader().loadFrom({ isConfig: true })) // merge arrays and remove duplicates by spreading a set return [...new Set([...credentials, ...config])] }