Skip to content

Commit 52ea37e

Browse files
authored
chore: Merge pull request #208 from googlemaps/wangela/new
chore: add release-please config
2 parents c154878 + b92775f commit 52ea37e

File tree

3 files changed

+96
-7
lines changed

3 files changed

+96
-7
lines changed

.github/workflows/release-please.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Copyright 2024 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 and npm releases,
17+
## and update the CHANGELOG.md.
18+
19+
on:
20+
push:
21+
branches: [main]
22+
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.ref }}
25+
cancel-in-progress: true
26+
27+
permissions:
28+
contents: write
29+
pull-requests: write
30+
31+
name: Release Please
32+
33+
jobs:
34+
release-please:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- id: release
38+
name: Release Please
39+
uses: google-github-actions/release-please-action@v4
40+
41+
with:
42+
release-type: node
43+
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
44+
package-name: "@googlemaps/react-native-navigation-sdk"
45+
bump-minor-pre-major: true
46+
47+
# Everything below is for NPM publishing when a release is cut.
48+
# Note the "if" statement on all commands to make sure that publishing
49+
# only happens when a release is cut.
50+
51+
- if: ${{ steps.release.outputs.release_created }}
52+
name: Checkout
53+
uses: actions/checkout@v4
54+
55+
- if: ${{ steps.release.outputs.release_created }}
56+
name: Setup Node for Dependency Installation
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: 20
60+
cache: npm
61+
62+
- if: ${{ steps.release.outputs.release_created }}
63+
name: Install Dependencies
64+
run: npm ci
65+
66+
# Now configure node with the registry used for publishing
67+
- if: ${{ steps.release.outputs.release_created }}
68+
name: Setup Node for Publishing
69+
uses: actions/setup-node@v4
70+
with:
71+
node-version: 20
72+
registry-url: "https://wombat-dressing-room.appspot.com/"
73+
74+
- if: ${{ steps.release.outputs.release_created }}
75+
name: Publish
76+
# npm publish will trigger the build via the prepack hook
77+
run: npm publish
78+
env:
79+
NODE_AUTH_TOKEN: ${{ secrets.NPM_WOMBOT_TOKEN }}

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Description
44

5-
This repository contains a React Native plugin that provides a [Google Navigation](https://developers.google.com/maps/documentation/navigation) widget to React Native apps targeting Android and iOS.
5+
This repository contains a React Native plugin that provides a [Google Navigation](https://developers.google.com/maps/documentation/navigation) component for building native Android and iOS apps using React.
66

77
> [!NOTE]
88
> This package is in Beta until it reaches version 1.0. According to [semantic versioning](https://semver.org/#spec-item-4), breaking changes may be introduced before 1.0.
@@ -29,11 +29,17 @@ This repository contains a React Native plugin that provides a [Google Navigatio
2929
3030
## Installation
3131

32-
1. To install the library run the following command from your project root:
32+
This package is listed on NPM as [@googlemaps/react-native-navigation-sdk](https://www.npmjs.com/package/@googlemaps/react-native-navigation-sdk). Install it with:
3333

34-
`npm install --save https://github.com/googlemaps/react-native-navigation-sdk#{version_tag}`
34+
```shell
35+
npm i @googlemaps/react-native-navigation-sdk
36+
```
37+
38+
In your TSX or JSX file, import the components you need:
3539

36-
For more details, see [Google Navigation SDK Documentation](https://developers.google.com/maps/documentation/navigation).
40+
```tsx
41+
import { NavigationView } from '@googlemaps/react-native-navigation-sdk';
42+
```
3743

3844
### Android
3945

@@ -120,8 +126,8 @@ import {request, PERMISSIONS, RESULTS} from 'react-native-permissions';
120126
// Request permission for accessing the device's location.
121127
const requestPermissions = async () => {
122128
const result = await request(
123-
Platform.OS === "android" ?
124-
PERMISSIONS.ANDROID.ACCESS_COARSE_LOCATION :
129+
Platform.OS === "android" ?
130+
PERMISSIONS.ANDROID.ACCESS_COARSE_LOCATION :
125131
PERMISSIONS.IOS.LOCATION_ALWAYS,
126132
);
127133

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "react-native-navigation-sdk",
33
"version": "1.0.0-beta",
44
"author": "Google",
5-
"description": "A react-native library for Google's Navigation SDK",
5+
"description": "A React Native library for Navigation SDK on Google Maps Platform",
66
"main": "lib/commonjs/index",
77
"module": "lib/module/index",
88
"types": "lib/typescript/src/index.d.ts",
@@ -41,6 +41,7 @@
4141
"android",
4242
"library",
4343
"google-navigation",
44+
"navigation-sdk",
4445
"navsdk"
4546
],
4647
"publishConfig": {
@@ -151,5 +152,8 @@
151152
}
152153
]
153154
]
155+
},
156+
"publishConfig": {
157+
"registry": "https://wombat-dressing-room.appspot.com"
154158
}
155159
}

0 commit comments

Comments
 (0)