From 0aa6609a3bd0a40d571798121dbda70fc614e17e Mon Sep 17 00:00:00 2001 From: chadcarlson Date: Wed, 3 Feb 2021 16:16:52 -0500 Subject: [PATCH 1/8] GH actions. --- .github/workflows/quality-assurance.yaml | 21 +++++++++++++++++++++ .gitignore | 1 + 2 files changed, 22 insertions(+) create mode 100644 .github/workflows/quality-assurance.yaml diff --git a/.github/workflows/quality-assurance.yaml b/.github/workflows/quality-assurance.yaml new file mode 100644 index 0000000..5eeefb1 --- /dev/null +++ b/.github/workflows/quality-assurance.yaml @@ -0,0 +1,21 @@ +--- +name: Quality Assurance +on: + push: ~ + pull_request: ~ + +jobs: + build: + name: Build and test on ${{ matrix.nodejs }} + runs-on: ubuntu-latest + strategy: + matrix: + node.js: [ '10.x', '12.x', '14.x' ] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.nodejs }} + - run: npm install + - run: npm run build --if-present + - run: npm test diff --git a/.gitignore b/.gitignore index 0ad02b9..6e2af91 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ node_modules lib package-lock.json +.github/workflows/npm-publish.yaml \ No newline at end of file From f8a24d753c4553a3b5c4d26d4ce49aefefa7facd Mon Sep 17 00:00:00 2001 From: chadcarlson Date: Wed, 3 Feb 2021 16:19:09 -0500 Subject: [PATCH 2/8] Remove x's. --- .github/workflows/quality-assurance.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quality-assurance.yaml b/.github/workflows/quality-assurance.yaml index 5eeefb1..73f4337 100644 --- a/.github/workflows/quality-assurance.yaml +++ b/.github/workflows/quality-assurance.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node.js: [ '10.x', '12.x', '14.x' ] + node.js: [ '10', '12', '14' ] steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 From 3b7381dfc7f37377bd0f30ecc15eaaed3d1a32e0 Mon Sep 17 00:00:00 2001 From: chadcarlson Date: Wed, 3 Feb 2021 16:20:41 -0500 Subject: [PATCH 3/8] Typo. --- .github/workflows/quality-assurance.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quality-assurance.yaml b/.github/workflows/quality-assurance.yaml index 73f4337..03a4128 100644 --- a/.github/workflows/quality-assurance.yaml +++ b/.github/workflows/quality-assurance.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node.js: [ '10', '12', '14' ] + nodejs: [ '10.x', '12.x', '14.x' ] steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 From ba9de6aca3f3e5a5d3e4ebd8d61f6d04cd623aac Mon Sep 17 00:00:00 2001 From: chadcarlson Date: Wed, 3 Feb 2021 16:23:29 -0500 Subject: [PATCH 4/8] Remove x's again. --- .github/workflows/quality-assurance.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quality-assurance.yaml b/.github/workflows/quality-assurance.yaml index 03a4128..db8ebf0 100644 --- a/.github/workflows/quality-assurance.yaml +++ b/.github/workflows/quality-assurance.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - nodejs: [ '10.x', '12.x', '14.x' ] + nodejs: [ '10', '12', '14' ] steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 From 6d7bc9a51bbe5b0c5b708a8b00fdc0cf922d1d77 Mon Sep 17 00:00:00 2001 From: chadcarlson Date: Wed, 3 Feb 2021 16:25:51 -0500 Subject: [PATCH 5/8] Message. --- .github/workflows/quality-assurance.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quality-assurance.yaml b/.github/workflows/quality-assurance.yaml index db8ebf0..a229516 100644 --- a/.github/workflows/quality-assurance.yaml +++ b/.github/workflows/quality-assurance.yaml @@ -6,7 +6,7 @@ on: jobs: build: - name: Build and test on ${{ matrix.nodejs }} + name: [Build/test] Node.js ${{ matrix.nodejs }} runs-on: ubuntu-latest strategy: matrix: From 6db1ae6ecb9cf2d7e534380b3c08e0eb0f471301 Mon Sep 17 00:00:00 2001 From: chadcarlson Date: Wed, 3 Feb 2021 16:26:39 -0500 Subject: [PATCH 6/8] strings. --- .github/workflows/quality-assurance.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quality-assurance.yaml b/.github/workflows/quality-assurance.yaml index a229516..89d59c7 100644 --- a/.github/workflows/quality-assurance.yaml +++ b/.github/workflows/quality-assurance.yaml @@ -6,7 +6,7 @@ on: jobs: build: - name: [Build/test] Node.js ${{ matrix.nodejs }} + name: '[Build/test] Node.js ${{ matrix.nodejs }}' runs-on: ubuntu-latest strategy: matrix: From 1de0a1337b806b00c9ef37a1e79bc2e6962a9cbf Mon Sep 17 00:00:00 2001 From: chadcarlson Date: Wed, 3 Feb 2021 16:43:45 -0500 Subject: [PATCH 7/8] Publish action. --- .github/workflows/npm-publish.yaml | 19 +++++++++++++++++++ .gitignore | 1 - CHANGELOG.md | 10 +++++++++- README.md | 2 ++ 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/npm-publish.yaml diff --git a/.github/workflows/npm-publish.yaml b/.github/workflows/npm-publish.yaml new file mode 100644 index 0000000..caf6bb4 --- /dev/null +++ b/.github/workflows/npm-publish.yaml @@ -0,0 +1,19 @@ +--- +name: Publish (npm) +on: + push: ~ + +jobs: + deploy: + name: Publish to npm + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '10.x' + registry-url: 'https://registry.npmjs.org' + - run: npm install + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index 6e2af91..0ad02b9 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,3 @@ node_modules lib package-lock.json -.github/workflows/npm-publish.yaml \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2975433..5311d03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,19 @@ # Changelog -## [2.4.0] - 2020-11-17 +## [2.4.0] - 2021-02-03 ### Added +* GitHub actions for tests (`quality-assurance.yaml`) and publishing to npm (`npm-publish.yaml`). + +### Changed + * `config` method can now get an object `{ varPrefix: string }` to specify a different environment variables prefix. +### Removed + +* CircleCI action config. + ## [2.3.1] - 2019-11-04 ### Added diff --git a/README.md b/README.md index 3c63465..5c10525 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Platform.sh Config Reader (Node.js) +![Quality Assurance](https://github.com/platformsh/config-reader-nodejs/workflows/Quality%20Assurance/badge.svg) + This library provides a streamlined and easy to use way to interact with a Platform.sh environment. It offers utility methods to access routes and relationships more cleanly than reading the raw environment variables yourself. This library requires Node.js 10 or later. From 232b7586681b3a4762257e619d8b871bb1ea31cf Mon Sep 17 00:00:00 2001 From: chadcarlson Date: Wed, 3 Feb 2021 16:49:04 -0500 Subject: [PATCH 8/8] Tag check. --- .github/workflows/npm-publish.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/npm-publish.yaml b/.github/workflows/npm-publish.yaml index caf6bb4..ce2ea14 100644 --- a/.github/workflows/npm-publish.yaml +++ b/.github/workflows/npm-publish.yaml @@ -14,6 +14,8 @@ jobs: node-version: '10.x' registry-url: 'https://registry.npmjs.org' - run: npm install - - run: npm publish + - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish +