Skip to content

Commit f441900

Browse files
usefulthinkwangela
andauthored
chore: replace semantic-release with release-please (#820)
Co-authored-by: Angela Yu <5506675+wangela@users.noreply.github.com>
1 parent 4db90e2 commit f441900

File tree

5 files changed

+122
-86
lines changed

5 files changed

+122
-86
lines changed

.github/workflows/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ permissions:
1919
contents: write
2020

2121
jobs:
22+
test:
23+
uses: ./.github/workflows/test.yml
24+
2225
dependabot:
26+
needs: test
2327
runs-on: ubuntu-latest
2428
if: ${{ github.actor == 'dependabot[bot]' }}
2529
env:

.github/workflows/docs.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,31 @@
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@v3
22-
- uses: actions/cache@v3
21+
- name: Checkout
22+
uses: actions/checkout@v4
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
32-
if: github.ref == 'refs/heads/main'
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+
- if: github.ref == 'refs/heads/main'
37+
name: Publish to GitHub Pages
38+
uses: peaceiris/actions-gh-pages@v3
39+
3340
with:
3441
github_token: ${{ secrets.GITHUB_TOKEN }}
3542
publish_dir: ./docs
36-
user_name: 'googlemaps-bot'
37-
user_email: 'googlemaps-bot@users.noreply.github.com'
43+
user_name: "googlemaps-bot"
44+
user_email: "googlemaps-bot@users.noreply.github.com"
3845
commit_message: ${{ github.event.head_commit.message }}
Lines changed: 75 additions & 0 deletions
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/markerclusterer"
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

Lines changed: 0 additions & 60 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,29 @@
1313
# limitations under the License.
1414

1515
name: Test
16-
on: [push, pull_request]
16+
on: [push, pull_request, workflow_call]
1717
jobs:
1818
test:
1919
runs-on: ubuntu-latest
20-
steps:
21-
- uses: actions/checkout@v3
22-
- uses: actions/cache@v3
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
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:
32+
npm ci
33+
34+
- name: Run eslint
35+
run: npm run lint
36+
37+
- name: Run Tests
38+
run: npm test
39+
40+
- name: Collect Coverage Data
41+
uses: codecov/codecov-action@v1

0 commit comments

Comments
 (0)