Skip to content

Commit

Permalink
build(package): add github workflow to release npm package
Browse files Browse the repository at this point in the history
+ lint

this addresses #2
  • Loading branch information
Kribl, Dennis committed Sep 7, 2020
1 parent 09b7fe2 commit c0a65a2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/release-npm.yml
Original file line number Diff line number Diff line change
@@ -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}}
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <matthias.rohmer@immowelt.de>",
"author": {
"name": "Immowelt AG",
"email": "support@immowelt.de"
},
"license": "MIT"
}
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/extensions/aws-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ const createChain = <T, K>(

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])]
}

0 comments on commit c0a65a2

Please sign in to comment.