Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add release-please config #208

Merged
merged 5 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Copyright 2024 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.

## Runs the release-please action for all new pushes to the main branch.
## This will create new release-PRs, create GitHub and npm releases,
## and update the CHANGELOG.md.

on:
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write
pull-requests: write

name: Release Please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- id: release
name: Release Please
uses: google-github-actions/release-please-action@v4

with:
release-type: node
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
package-name: "@googlemaps/react-native-navigation-sdk"
bump-minor-pre-major: true

# Everything below is for NPM publishing when a release is cut.
# Note the "if" statement on all commands to make sure that publishing
# only happens when a release is cut.

- if: ${{ steps.release.outputs.release_created }}
name: Checkout
uses: actions/checkout@v4

- if: ${{ steps.release.outputs.release_created }}
name: Setup Node for Dependency Installation
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- if: ${{ steps.release.outputs.release_created }}
name: Install Dependencies
run: npm ci

# Now configure node with the registry used for publishing
- if: ${{ steps.release.outputs.release_created }}
name: Setup Node for Publishing
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://wombat-dressing-room.appspot.com/"

- if: ${{ steps.release.outputs.release_created }}
name: Publish
# npm publish will trigger the build via the prepack hook
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_WOMBOT_TOKEN }}
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Description

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

> [!NOTE]
> 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.
Expand All @@ -29,11 +29,17 @@ This repository contains a React Native plugin that provides a [Google Navigatio

## Installation

1. To install the library run the following command from your project root:
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:

`npm install --save https://github.com/googlemaps/react-native-navigation-sdk#{version_tag}`
```shell
npm i @googlemaps/react-native-navigation-sdk
```

In your TSX or JSX file, import the components you need:

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

### Android

Expand Down Expand Up @@ -120,8 +126,8 @@ import {request, PERMISSIONS, RESULTS} from 'react-native-permissions';
// Request permission for accessing the device's location.
const requestPermissions = async () => {
const result = await request(
Platform.OS === "android" ?
PERMISSIONS.ANDROID.ACCESS_COARSE_LOCATION :
Platform.OS === "android" ?
PERMISSIONS.ANDROID.ACCESS_COARSE_LOCATION :
PERMISSIONS.IOS.LOCATION_ALWAYS,
);

Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "react-native-navigation-sdk",
"version": "1.0.0-beta",
"author": "Google",
"description": "A react-native library for Google's Navigation SDK",
"description": "A React Native library for Navigation SDK on Google Maps Platform",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/src/index.d.ts",
Expand Down Expand Up @@ -41,6 +41,7 @@
"android",
"library",
"google-navigation",
"navigation-sdk",
"navsdk"
],
"publishConfig": {
Expand Down Expand Up @@ -151,5 +152,8 @@
}
]
]
},
"publishConfig": {
"registry": "https://wombat-dressing-room.appspot.com"
}
}
Loading