Skip to content

Commit add7549

Browse files
committed
feat: Adding release and publish workflows
1 parent 31d2d19 commit add7549

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright 2020 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+
name: Release
16+
on:
17+
push:
18+
branches: [ main ]
19+
jobs:
20+
release:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
with:
26+
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
27+
- name: Build APKs
28+
run: |
29+
echo "Generating ApiDemos (Java) APKs"
30+
cd ./ApiDemos/java
31+
./gradlew assembleV3 assembleGms
32+
cp ./app/build/outputs/apk/gms/debug/app-gms-debug.apk $GITHUB_WORKSPACE/ApiDemos-java-gms-debug.apk
33+
cp ./app/build/outputs/apk/v3/debug/app-v3-debug.apk $GITHUB_WORKSPACE/ApiDemos-java-v3-debug.apk
34+
35+
echo "Generating Kotlin (Kotlin) APKs"
36+
cd ./ApiDemos/kotlin
37+
./gradlew assembleV3 assembleGms
38+
cp ./app/build/outputs/apk/gms/debug/app-gms-debug.apk $GITHUB_WORKSPACE/ApiDemos-kotlin-gms-debug.apk
39+
cp ./app/build/outputs/apk/v3/debug/app-v3-debug.apk $GITHUB_WORKSPACE/ApiDemos-kotlin-v3-debug.apk
40+
41+
- name: Semantic Release
42+
uses: cycjimmy/semantic-release-action@v2
43+
with:
44+
extra_plugins: |
45+
"@semantic-release/commit-analyzer"
46+
"@semantic-release/release-notes-generator"
47+
"@google/semantic-release-replace-plugin"
48+
"@semantic-release/git
49+
"@semantic-release/github
50+
env:
51+
GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}

.releaserc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
branches:
2+
- main
3+
plugins:
4+
- "@semantic-release/commit-analyzer"
5+
- "@semantic-release/release-notes-generator"
6+
- - "@google/semantic-release-replace-plugin"
7+
- replacements:
8+
- files:
9+
- "./ApiDemos/java/app/build.gradle"
10+
- "./ApiDemos/kotlin/app/build.gradle"
11+
from: "versionName = \".*\""
12+
to: "versionName = \"${nextRelease.version}\""
13+
- - "@semantic-release/git"
14+
- assets:
15+
- "./ApiDemos/java/app/build.gradle"
16+
- "./ApiDemos/kotlin/app/build.gradle"
17+
- "@semantic-release/github"
18+
- assets:
19+
- "./ApiDemos-java-gms-debug.apk"
20+
- "./ApiDemos-java-v3-debug.apk"
21+
- "./ApiDemos-kotlin-gms-debug.apk"
22+
- "./ApiDemos-kotlin-v3-debug.apk"
23+
options:
24+
debug: true

0 commit comments

Comments
 (0)