Skip to content

Commit 592aec5

Browse files
authored
chore: introduce release-please and update dependencies (#572)
* chore: update dependencies * chore: update build-script for bundlewatch * chore: add release-please, update all other workflows
1 parent beb7efd commit 592aec5

12 files changed

+4168
-4037
lines changed

.github/workflows/bundlewatch.yml

+15-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,21 @@ jobs:
2727
env:
2828
CI_BRANCH_BASE: main
2929
steps:
30-
- uses: actions/checkout@v2
31-
- uses: jackyef/bundlewatch-gh-action@b9753bc9b3ea458ff21069eaf6206e01e046f0b5
30+
- name: Checkout
31+
uses: actions/checkout@v3
32+
33+
- name: Setup Node
34+
uses: actions/setup-node@v3
35+
with:
36+
node-version: 20
37+
cache: npm
38+
39+
- name: Install Dependencies
40+
run: npm ci
41+
42+
- name: Bundlewatch
43+
uses: jackyef/bundlewatch-gh-action@b9753bc9b3ea458ff21069eaf6206e01e046f0b5
3244
with:
33-
build-script: npm i
45+
build-script: npm run prepack
3446
bundlewatch-github-token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
3547
bundlewatch-config: .github/bundlewatch.config.json

.github/workflows/codeql.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353

5454
steps:
5555
- name: Checkout repository
56-
uses: actions/checkout@v2
56+
uses: actions/checkout@v3
5757

5858
# Initializes the CodeQL tools for scanning.
5959
- name: Initialize CodeQL

.github/workflows/docs.yml

+17-11
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,26 @@
1515
name: Docs
1616
on: [push, pull_request]
1717
jobs:
18-
test:
18+
docs:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v2
22-
- uses: actions/cache@v2
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v3
2326
with:
24-
path: ~/.npm
25-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
26-
restore-keys: |
27-
${{ runner.os }}-node-
28-
- run: |
29-
npm i
30-
npm run docs
31-
- uses: peaceiris/actions-gh-pages@v3
27+
node-version: 20
28+
cache: npm
29+
30+
- name: Install Dependencies
31+
run: npm ci
32+
33+
- name: Build Documentation
34+
run: npm run docs
35+
36+
- name: Deploy to GitHub Pages
37+
uses: peaceiris/actions-gh-pages@v3
3238
if: github.ref == 'refs/heads/main'
3339
with:
3440
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/e2e.yml

+28-6
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,20 @@ jobs:
2828
ports:
2929
- 4444:4444
3030
steps:
31-
- uses: actions/checkout@v2
32-
- run: npm i
33-
- run: npm run test:e2e
31+
- name: Checkout
32+
uses: actions/checkout@v3
33+
34+
- name: Setup Node
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: 20
38+
cache: npm
39+
40+
- name: Install Dependencies
41+
run: npm ci
42+
43+
- name: End to End Tests
44+
run: npm run test:e2e
3445
env:
3546
GOOGLE_MAPS_API_KEY: ${{ secrets.SYNCED_GOOGLE_MAPS_API_KEY_WEB }}
3647
firefox:
@@ -43,9 +54,20 @@ jobs:
4354
ports:
4455
- 4444:4444
4556
steps:
46-
- uses: actions/checkout@v2
47-
- run: npm i
48-
- run: npm run test:e2e
57+
- name: Checkout
58+
uses: actions/checkout@v3
59+
60+
- name: Setup Node
61+
uses: actions/setup-node@v3
62+
with:
63+
node-version: 20
64+
cache: npm
65+
66+
- name: Install Dependencies
67+
run: npm ci
68+
69+
- name: End to End Tests
70+
run: npm run test:e2e
4971
env:
5072
GOOGLE_MAPS_API_KEY: ${{ secrets.SYNCED_GOOGLE_MAPS_API_KEY_WEB }}
5173
BROWSER: firefox

.github/workflows/release-please.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
## Runs the release-please action for all new pushes to the main branch.
16+
## This will create new release-PRs, create GitHub releases and update
17+
## the CHANGELOG.md.
18+
19+
on:
20+
push:
21+
branches: [main]
22+
23+
permissions:
24+
contents: write
25+
pull-requests: write
26+
27+
name: Release Please
28+
29+
jobs:
30+
release-please:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- id: release
34+
name: Release Please
35+
uses: google-github-actions/release-please-action@v3
36+
37+
with:
38+
release-type: node
39+
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
40+
package-name: "@googlemaps/typescript-guards"
41+
bump-minor-pre-major: true
42+
43+
# Everything below is for NPM publishing when a release is cut.
44+
# Note the "if" statement on all commands to make sure that publishing
45+
# only happens when a release is cut.
46+
47+
- if: ${{ steps.release.outputs.release_created }}
48+
name: Checkout
49+
uses: actions/checkout@v3
50+
51+
- if: ${{ steps.release.outputs.release_created }}
52+
name: Setup Node for Dependency Installation
53+
uses: actions/setup-node@v3
54+
with:
55+
node-version: 20
56+
cache: npm
57+
58+
- if: ${{ steps.release.outputs.release_created }}
59+
name: Install Dependencies
60+
run: npm ci
61+
62+
# Now configure node with the registry used for publishing
63+
- if: ${{ steps.release.outputs.release_created }}
64+
name: Setup Node for Publishing
65+
uses: actions/setup-node@v3
66+
with:
67+
node-version: 20
68+
registry-url: "https://wombat-dressing-room.appspot.com/"
69+
70+
- if: ${{ steps.release.outputs.release_created }}
71+
name: Publish
72+
# npm publish will trigger the build via the prepack hook
73+
run: npm publish
74+
env:
75+
NODE_AUTH_TOKEN: ${{ secrets.NPM_WOMBAT_TOKEN }}

.github/workflows/release.yml

-57
This file was deleted.

.github/workflows/test.yml

+20-11
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,24 @@ on: [push, pull_request]
1717
jobs:
1818
test:
1919
runs-on: ubuntu-latest
20-
steps:
21-
- uses: actions/checkout@v2
22-
- uses: actions/cache@v2
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v3
2326
with:
24-
path: ~/.npm
25-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
26-
restore-keys: |
27-
${{ runner.os }}-node-
28-
- run: npm i
29-
- run: npm run lint
30-
- run: npm test
31-
- uses: codecov/codecov-action@v1
27+
node-version: 20
28+
cache: npm
29+
30+
- name: Install Dependencies
31+
run: npm ci
32+
33+
- name: Run eslint
34+
run: npm run lint
35+
36+
- name: Run Tests
37+
run: npm test
38+
39+
- name: Collect Coverage Data
40+
uses: codecov/codecov-action@v1

jest.config.mjs

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
*/
1616

1717
export default {
18-
transform: {
19-
"^.+\\.tsx?$": "ts-jest",
20-
},
18+
preset: "ts-jest/presets/js-with-ts",
19+
testEnvironment: "jsdom",
2120
collectCoverage: true,
2221
coverageThreshold: {
2322
global: {

0 commit comments

Comments
 (0)