From 37a12fa39cb098deb257cf8c5c9edfd5b3c05e32 Mon Sep 17 00:00:00 2001 From: Justin Poehnelt Date: Fri, 17 Sep 2021 11:29:17 -0600 Subject: [PATCH] chore: standardize repos (#294) --- .github/workflows/ci.yml | 3 +-- .github/workflows/docs.yml | 32 ++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 30 +++++++++++------------------- package.json | 4 ++-- 4 files changed, 46 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61741e6..a3aac05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,5 +22,4 @@ jobs: - run: npm i - run: npm run lint - run: npm test - - run: npm run docs - uses: codecov/codecov-action@v1 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..c145b63 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,32 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Docs +on: [push, pull_request] +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: | + npm i + npm run docs + - uses: peaceiris/actions-gh-pages@v3 + if: github.ref == 'refs/heads/main' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs + user_name: 'googlemaps-bot' + user_email: 'googlemaps-bot@users.noreply.github.com' + commit_message: ${{ github.event.head_commit.message }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a77aef..330892b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,11 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: "Release" +name: Release on: push: branches: - main +concurrency: release jobs: build: runs-on: ubuntu-latest @@ -25,28 +26,19 @@ jobs: - name: Test run: | npm i + npm run lint npm test - name: Release uses: cycjimmy/semantic-release-action@v2 with: extra_plugins: | - "@semantic-release/commit-analyzer" - "@semantic-release/release-notes-generator" - "@semantic-release/git - "@semantic-release/github - "@semantic-release/npm + @semantic-release/commit-analyzer + semantic-release-interval + @semantic-release/release-notes-generator + @semantic-release/git + @semantic-release/github + @semantic-release/npm + @googlemaps/semantic-release-config env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_WOMBAT_TOKEN }} - - run: | - npm i - npm run docs - cp -r dist docs/dist - cp -r examples docs/examples - - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs - user_name: 'googlemaps-bot' - user_email: 'googlemaps-bot@users.noreply.github.com' - commit_message: ${{ github.event.head_commit.message }} diff --git a/package.json b/package.json index 978e320..0d83989 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,10 @@ "module": "dist/index.esm.js", "types": "dist/index.d.ts", "scripts": { - "docs": "typedoc src/index.ts", + "docs": "typedoc src/index.ts && cp -r dist docs/dist && cp -r examples docs/examples", "format": "prettier *.json *.js e2e/* examples/*.html --write && eslint src/* --fix", "lint": "eslint src/*", - "prepare": "rollup -c", + "prepare": "rm -rf dist && rollup -c", "test": "jest src/*", "test:e2e": "jest --passWithNoTests e2e/*" },