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

feat: Add Android lib files. #42

Merged
merged 1 commit into from
Oct 4, 2021
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
14 changes: 14 additions & 0 deletions .github/sync-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ group:
# gh repo list googlemaps --public --source --no-archived --json name | jq '.[] | .name'
repos: |
googlemaps/.github
googlemaps/android-v3-migration
googlemaps/android-maps-ktx
googlemaps/android-maps-rx
googlemaps/android-maps-utils
Expand Down Expand Up @@ -74,3 +75,16 @@ group:
googlemaps/playablelocations-proxy
googlemaps/react-wrapper
googlemaps/semantic-release-config
# Android Library files
- files:
- source: sync-files/android/.github/
dest: .github/
- source: sync-files/android/.releaserc
dest: .releaserc
repos: |
googlemaps/android-maps-ktx
googlemaps/android-maps-rx
googlemaps/android-maps-utils
googlemaps/android-places-ktx
googlemaps/android-v3-migration
# Exclude Android sample repos
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@

.DS_Store
59 changes: 59 additions & 0 deletions sync-files/android/.github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright 2020 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.

name: Release
on:
push:
branches: [ main ]
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
- uses: gradle/wrapper-validation-action@v1.0.4
- name: Create .gpg key
run: |
echo $GPG_KEY_ARMOR | base64 --decode > ./release.asc
gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc
echo "Build and publish"
sed -i -e "s,sonatypeUsername=,sonatypeUsername=$SONATYPE_USERNAME,g" gradle.properties
SONATYPE_PASSWORD_ESCAPED=$(printf '%s\n' "$SONATYPE_PASSWORD" | sed -e 's/[\/&]/\\&/g')
sed -i -e "s,sonatypePassword=,sonatypePassword=$SONATYPE_PASSWORD_ESCAPED,g" gradle.properties
sed -i -e "s,signing.keyId=,signing.keyId=$GPG_KEY_ID,g" gradle.properties
sed -i -e "s,signing.password=,signing.password=$GPG_PASSWORD,g" gradle.properties
sed -i -e "s,signing.secretKeyRingFile=,signing.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg,g" gradle.properties
env:
GPG_KEY_ARMOR: "${{ secrets.SYNCED_GPG_KEY_ARMOR }}"
GPG_KEY_ID: ${{ secrets.SYNCED_GPG_KEY_ID }}
GPG_PASSWORD: ${{ secrets.SYNCED_GPG_KEY_PASSWORD }}
SONATYPE_PASSWORD: ${{ secrets.SYNCED_SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SYNCED_SONATYPE_USERNAME }}
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
"@semantic-release/commit-analyzer"
"@semantic-release/release-notes-generator"
"@google/semantic-release-replace-plugin"
"@semantic-release/exec"
"@semantic-release/git
"@semantic-release/github
env:
GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
46 changes: 46 additions & 0 deletions sync-files/android/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2020 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.

# A workflow that runs tests on every new pull request
name: Run unit tests

on:
repository_dispatch:
types: [test]
push:
branches: ['*']
pull_request:
branches: ['*']
workflow_dispatch:

jobs:
run-unit-test:
runs-on: ubuntu-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repo
uses: actions/checkout@v2

- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1.0.4

- name: Set up JDK 11
uses: actions/setup-java@v2.3.0
with:
java-version: '11'
distribution: 'adopt'

- name: Build modules
run: ./gradlew build jacocoTestReport --stacktrace
25 changes: 25 additions & 0 deletions sync-files/android/.releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
branches:
- main
plugins:
- "@semantic-release/commit-analyzer"
- "@semantic-release/release-notes-generator"
- - "@google/semantic-release-replace-plugin"
- replacements:
- files:
- "./build.gradle(.kts)?"
from: "\\bversion = '.*'"
to: "version = '${nextRelease.version}'"
- files:
- "README.md"
from: "ktx:[0-9].[0-9].[0-9]"
to: "ktx:${nextRelease.version}"
- - "@semantic-release/exec"
- prepareCmd: "./gradlew build --warn --stacktrace"
publishCmd: "./gradlew publish --warn --stacktrace"
- - "@semantic-release/git"
- assets:
- "./build.gradle(.kts)?"
- "*.md"
- "@semantic-release/github"
options:
debug: true