Browse Source

chore: standardize repos (#294)

main
Justin Poehnelt 3 years ago committed by GitHub
parent
commit
37a12fa39c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      .github/workflows/ci.yml
  2. 32
      .github/workflows/docs.yml
  3. 30
      .github/workflows/release.yml
  4. 4
      package.json

3
.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"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -22,5 +22,4 @@ jobs:
- run: npm i - run: npm i
- run: npm run lint - run: npm run lint
- run: npm test - run: npm test
- run: npm run docs
- uses: codecov/codecov-action@v1 - uses: codecov/codecov-action@v1

32
.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 }}

30
.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"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with 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 # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
name: "Release" name: Release
on: on:
push: push:
branches: branches:
- main - main
concurrency: release
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -25,28 +26,19 @@ jobs:
- name: Test - name: Test
run: | run: |
npm i npm i
npm run lint
npm test npm test
- name: Release - name: Release
uses: cycjimmy/semantic-release-action@v2 uses: cycjimmy/semantic-release-action@v2
with: with:
extra_plugins: | extra_plugins: |
"@semantic-release/commit-analyzer" @semantic-release/commit-analyzer
"@semantic-release/release-notes-generator" semantic-release-interval
"@semantic-release/git @semantic-release/release-notes-generator
"@semantic-release/github @semantic-release/git
"@semantic-release/npm @semantic-release/github
@semantic-release/npm
@googlemaps/semantic-release-config
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_WOMBAT_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 }}

4
package.json

@ -25,10 +25,10 @@
"module": "dist/index.esm.js", "module": "dist/index.esm.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"scripts": { "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", "format": "prettier *.json *.js e2e/* examples/*.html --write && eslint src/* --fix",
"lint": "eslint src/*", "lint": "eslint src/*",
"prepare": "rollup -c", "prepare": "rm -rf dist && rollup -c",
"test": "jest src/*", "test": "jest src/*",
"test:e2e": "jest --passWithNoTests e2e/*" "test:e2e": "jest --passWithNoTests e2e/*"
}, },

Loading…
Cancel
Save