From 87d3470a0faf30adf9b32eb8efbb631a9aed2e8a Mon Sep 17 00:00:00 2001 From: nmccready Date: Tue, 19 Sep 2023 15:49:55 -0400 Subject: [PATCH 1/9] chore: trying to automate github / dependabot updates --- .github/workflows/go_node.yml | 10 +++++----- go.mod | 12 +++++++++++- package.json | 5 ++++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/go_node.yml b/.github/workflows/go_node.yml index f12723e..34c1e27 100644 --- a/.github/workflows/go_node.yml +++ b/.github/workflows/go_node.yml @@ -2,9 +2,9 @@ name: Go / Node on: push: - branches: ['main'] + branches: ["main"] pull_request: - branches: ['main'] + branches: ["main"] jobs: test: @@ -14,7 +14,7 @@ jobs: - name: node uses: actions/setup-node@v3 with: - node-version-file: '.nvmrc' + node-version-file: ".nvmrc" # cache: "npm" # needs lockfile if enabled - name: go @@ -23,5 +23,5 @@ jobs: go-version: 1.19 - run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.1 - run: npm install - # - run: npm run lint - # - run: npm test + - run: npm run lint + - run: npm test diff --git a/go.mod b/go.mod index a7c32d3..adfae61 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,18 @@ module github.com/nmccready/aws-play -go 1.14 +go 1.19 require ( github.com/aws/aws-sdk-go v1.45.11 github.com/nmccready/go-debug v0.5.0 ) + +require ( + github.com/fatih/color v1.9.0 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/mattn/go-colorable v0.1.4 // indirect + github.com/mattn/go-isatty v0.0.11 // indirect + github.com/nmccready/colorjson v0.1.0 // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect + golang.org/x/sys v0.1.0 // indirect +) diff --git a/package.json b/package.json index 38410c6..b51f044 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,10 @@ "debug.js" ], "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "lint": "golangci-lint run --fix", + "test": "npm run test:go", + "test:go": "go test ./aws/...", + "prepare": "go mod tidy -e && go mod vendor" }, "author": "", "license": "MIT" From 8ba65f711df753e2d72aad6647c6224f33c91851 Mon Sep 17 00:00:00 2001 From: nmccready Date: Tue, 19 Sep 2023 15:50:10 -0400 Subject: [PATCH 2/9] chore: tooling config --- .nvmrc | 1 + .prototools | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 .nvmrc create mode 100644 .prototools diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..f6ff5a4 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +16.X diff --git a/.prototools b/.prototools new file mode 100644 index 0000000..a5899c1 --- /dev/null +++ b/.prototools @@ -0,0 +1,2 @@ +go = "1.19" +node = "16" From 8376143652322a52929a41a3f3ff3941e0a8044f Mon Sep 17 00:00:00 2001 From: nmccready Date: Tue, 19 Sep 2023 20:02:30 -0400 Subject: [PATCH 3/9] chore(release): 0.1.3 --- CHANGELOG.md | 5 +++++ package.json | 32 ++++++++++++++++++-------------- 2 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..95fce40 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +### [0.1.3](https://github.com/nmccready/aws-play/compare/v0.1.2...v0.1.3) (2023-09-20) diff --git a/package.json b/package.json index b51f044..b5088fe 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,12 @@ { "name": "@znemz/aws-play", - "version": "0.1.2", + "version": "0.1.3", "description": "", - "dependencies": { - "aws-sdk": "^2.781.0", - "debug-fabulous": "^2.0.1", - "proxy-agent": "6.3.1", - "through2": "^4.0.2", - "yargs": "^17.7.2" - }, + "license": "MIT", + "author": "", "bin": { - "awsKmsEncrypt": "aws/kms/encrypt/cli.js", - "awsKmsDecrypt": "aws/kms/decrypt/cli.js" + "awsKmsDecrypt": "aws/kms/decrypt/cli.js", + "awsKmsEncrypt": "aws/kms/encrypt/cli.js" }, "files": [ "aws/**/*", @@ -19,10 +14,19 @@ ], "scripts": { "lint": "golangci-lint run --fix", + "prepare": "go mod tidy -e && go mod vendor && sort-package-json && standard-version", "test": "npm run test:go", - "test:go": "go test ./aws/...", - "prepare": "go mod tidy -e && go mod vendor" + "test:go": "go test ./aws/..." }, - "author": "", - "license": "MIT" + "dependencies": { + "aws-sdk": "^2.781.0", + "debug-fabulous": "^2.0.1", + "proxy-agent": "6.3.1", + "through2": "^4.0.2", + "yargs": "^17.7.2" + }, + "devDependencies": { + "sort-package-json": "2.5.1", + "standard-version": "9.5.0" + } } From 65b54211b4822b8b9171aad216efb66e47c4efcd Mon Sep 17 00:00:00 2001 From: nmccready Date: Tue, 19 Sep 2023 20:05:47 -0400 Subject: [PATCH 4/9] chore: github actions and versioning --- .github/workflows/go_node.yml | 16 ++++++++++++++-- LICENSE | 21 +++++++++++++++++++++ package.json | 4 ++-- 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 LICENSE diff --git a/.github/workflows/go_node.yml b/.github/workflows/go_node.yml index 34c1e27..50d15e4 100644 --- a/.github/workflows/go_node.yml +++ b/.github/workflows/go_node.yml @@ -2,9 +2,9 @@ name: Go / Node on: push: - branches: ["main"] + branches: ["master"] pull_request: - branches: ["main"] + branches: ["master"] jobs: test: @@ -25,3 +25,15 @@ jobs: - run: npm install - run: npm run lint - run: npm test + + version: + runs-on: ubuntu-latest + steps: + - name: Publish to npm + working-directory: nodejs/ + run: | + git config --local user.email "creadbot@brick.com" + git config --local user.name "creadbot" + git push --quiet --tags ssh://git@github.com/nmccready/aws-play.git + npm run standard-version + npm publish --access public diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3c47f17 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2023 Nicholas McCready + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/package.json b/package.json index b5088fe..0131f8c 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "yargs": "^17.7.2" }, "devDependencies": { - "sort-package-json": "2.5.1", - "standard-version": "9.5.0" + "sort-package-json": "2.5", + "standard-version": "9.5" } } From b759dd27f2e442ac9bd2771900e8e08a1b8d622c Mon Sep 17 00:00:00 2001 From: nmccready Date: Tue, 19 Sep 2023 20:45:14 -0400 Subject: [PATCH 5/9] chore: github actions and versioning --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0131f8c..215cee3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@znemz/aws-play", - "version": "0.1.3", + "version": "0.1.2", "description": "", "license": "MIT", "author": "", From 209e6b17a751976270af41459f7a92abd4077425 Mon Sep 17 00:00:00 2001 From: nmccready Date: Tue, 19 Sep 2023 22:45:38 -0400 Subject: [PATCH 6/9] chore: attempt at multiple workflows --- .github/workflows/go_node.yml | 39 ---------------------------------- .github/workflows/publish.yml | 26 +++++++++++++++++++++++ .github/workflows/release.yml | 40 +++++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 28 ++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/go_node.yml create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/go_node.yml b/.github/workflows/go_node.yml deleted file mode 100644 index 50d15e4..0000000 --- a/.github/workflows/go_node.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Go / Node - -on: - push: - branches: ["master"] - pull_request: - branches: ["master"] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: node - uses: actions/setup-node@v3 - with: - node-version-file: ".nvmrc" - # cache: "npm" # needs lockfile if enabled - - - name: go - uses: actions/setup-go@v3 - with: - go-version: 1.19 - - run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.1 - - run: npm install - - run: npm run lint - - run: npm test - - version: - runs-on: ubuntu-latest - steps: - - name: Publish to npm - working-directory: nodejs/ - run: | - git config --local user.email "creadbot@brick.com" - git config --local user.name "creadbot" - git push --quiet --tags ssh://git@github.com/nmccready/aws-play.git - npm run standard-version - npm publish --access public diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e9c1454 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,26 @@ +name: publish + +on: + push: + tags: + - '*' + +jobs: + tests: + uses: ./.github/workflows/tests.yml + npm-publish: + runs-on: ubuntu-latest + needs: [tests] + steps: + - uses: actions/checkout@v4 + - name: node + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + registry-url: 'https://registry.npmjs.org' + - name: Publish to npm + run: | + npm run standard-version + npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d5aee8d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: release + +on: + push: + branches: ["master"] + tags-ignore: ['**'] + + +jobs: + tests: + uses: ./.github/workflows/tests.yml + npm-publish: + runs-on: ubuntu-latest + needs: [tests] + steps: + - uses: actions/checkout@v4 + - name: node + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + # cache: "npm" # needs lockfile if enabled + + - name: go + uses: actions/setup-go@v4 + with: + go-version: 1.19 + - name: tag release + run: | + npm install + npm run standard-version + git config --local user.email "creadbot@github.com" + git config --local user.name "creadbot_github" + echo "$SSH_KEY" > key + chmod 600 key + eval "$(ssh-agent -s)" + ssh-add key + git push --quiet --tags ssh://git@github.com/nmccready/aws-play.git + env: + SSH_KEY: ${{ secrets.SSH_KEY }} + diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..6ae803c --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,28 @@ +name: tests + +on: + workflow_call: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: node + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + # cache: "npm" # needs lockfile if enabled + + - name: go + uses: actions/setup-go@v4 + with: + go-version: 1.19 + - run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.1 + - run: npm install + - run: npm run lint + - run: npm test From ab50538de2a9a587d2ebc0559580068ee0906ddd Mon Sep 17 00:00:00 2001 From: nmccready Date: Tue, 19 Sep 2023 22:47:28 -0400 Subject: [PATCH 7/9] chore: attempt at multiple workflows node v3 --- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/tests.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e9c1454..89230ff 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: node - uses: actions/setup-node@v4 + uses: actions/setup-node@v3 with: node-version-file: ".nvmrc" registry-url: 'https://registry.npmjs.org' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d5aee8d..b966568 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: node - uses: actions/setup-node@v4 + uses: actions/setup-node@v3 with: node-version-file: ".nvmrc" # cache: "npm" # needs lockfile if enabled diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6ae803c..eeb3467 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: node - uses: actions/setup-node@v4 + uses: actions/setup-node@v3 with: node-version-file: ".nvmrc" # cache: "npm" # needs lockfile if enabled From d23243024d03703ae5dc69090f1dc25edd473cba Mon Sep 17 00:00:00 2001 From: nmccready Date: Tue, 19 Sep 2023 22:50:25 -0400 Subject: [PATCH 8/9] chore: thanks copilot --- .github/workflows/publish.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 89230ff..c3a24b0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,7 +7,7 @@ on: jobs: tests: - uses: ./.github/workflows/tests.yml + uses: ./.github/workflows/tests.yml npm-publish: runs-on: ubuntu-latest needs: [tests] diff --git a/package.json b/package.json index 215cee3..ed8af15 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ ], "scripts": { "lint": "golangci-lint run --fix", - "prepare": "go mod tidy -e && go mod vendor && sort-package-json && standard-version", + "prepare": "go mod tidy -e && go mod vendor && sort-package-json", "test": "npm run test:go", "test:go": "go test ./aws/..." }, From 1cb2ef041d3bf477a8073b118593e70cc8dad1c2 Mon Sep 17 00:00:00 2001 From: nmccready Date: Tue, 19 Sep 2023 23:09:22 -0400 Subject: [PATCH 9/9] chore: go lint --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eeb3467..6869519 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: uses: actions/setup-go@v4 with: go-version: 1.19 - - run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.1 + - run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.0 - run: npm install - run: npm run lint - run: npm test