Skip to content

Commit cbfb06c

Browse files
committed
feat: Adds a new release workflow; tweaks test workflow; adds dependabot workflow; adds new script to copy /dist to a bucket; deletes superfluous test workflow."
1 parent ed997bc commit cbfb06c

File tree

2 files changed

+98
-1
lines changed

2 files changed

+98
-1
lines changed

.github/workflows/playwright.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
branches: [ main ]
2020
pull_request:
2121
branches: [ main ]
22-
types: [opened]
22+
types: [opened, synchronize, edited]
2323
concurrency:
2424
group: test-${{ github.ref }}
2525
cancel-in-progress: true
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Copyright 2025 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, update
17+
## the CHANGELOG.md, and upload /dist to the Cloud bucket.
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+
with:
37+
release-type: node
38+
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
39+
package-name: "@googlemaps/js-api-samples"
40+
bump-minor-pre-major: true
41+
42+
- if: ${{ steps.release.outputs.release_created }}
43+
name: Checkout
44+
uses: actions/checkout@v3
45+
46+
- if: ${{ steps.release.outputs.release_created }}
47+
name: Setup Node
48+
uses: actions/setup-node@v3
49+
with:
50+
node-version: 20
51+
cache: 'npm' # Cache node_modules
52+
53+
- if: ${{ steps.release.outputs.release_created }}
54+
name: Install Dependencies
55+
run: npm ci
56+
57+
- if: ${{ steps.release.outputs.release_created }}
58+
name: Build
59+
run: npm run build
60+
61+
- if: ${{ steps.release.outputs.release_created }}
62+
name: Update dist
63+
run: |
64+
git config --global user.name 'googlemaps-bot'
65+
git config --global user.email '[email protected]'
66+
git add dist
67+
git commit -m "chore: update dist folder [skip ci]" || true
68+
git push origin
69+
70+
# Upload /dist to the Cloud bucket.
71+
- if: ${{ steps.release.outputs.release_created }}
72+
name: Upload to Cloud Bucket
73+
run: |
74+
bash ./upload-to-bucket.sh
75+
env:
76+
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_CLOUD_CREDENTIALS }}
77+
78+
# NPM Publishing (unchanged)
79+
- if: ${{ steps.release.outputs.release_created }}
80+
name: Setup Node for Publishing
81+
uses: actions/setup-node@v3
82+
with:
83+
node-version: 20
84+
registry-url: "https://wombat-dressing-room.appspot.com/"
85+
86+
- if: ${{ steps.release.outputs.release_created }}
87+
name: Publish
88+
run: npm publish
89+
env:
90+
NODE_AUTH_TOKEN: ${{ secrets.NPM_WOMBAT_TOKEN }}
91+
92+
- if: ${{ steps.release.outputs.release_created }}
93+
name: Upload to Cloud Bucket
94+
run: |
95+
bash ./upload-to-bucket.sh
96+
env:
97+
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_CLOUD_CREDENTIALS }}

0 commit comments

Comments
 (0)