Skip to content

Commit 6875a0d

Browse files
authored
feat(android): auto versioning tools (#27)
* feat(android): auto versioning tools * fix(release): fix package.json versioning * fix(releases): fix CI permissions * fix(android): fix versions * fix(releases): remove pr hook
1 parent 95c0ecb commit 6875a0d

File tree

7 files changed

+81
-22
lines changed

7 files changed

+81
-22
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@ on:
44
branches:
55
- 'main'
66

7-
# pull_request event is required only for autolabeler
8-
pull_request:
9-
types: [opened, reopened, synchronize]
7+
permissions:
8+
contents: read
109

1110
jobs:
1211
versions:
13-
name: Update Releases / Versions
12+
name: Update Releases
1413
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write # for release-drafter/release-drafter to create a github release
16+
pull-requests: write # for release-drafter/release-drafter to add label to PR
17+
1518
steps:
16-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
1720
with:
1821
token: ${{ secrets.GITHUB_TOKEN }}
1922

@@ -28,7 +31,7 @@ jobs:
2831
id: version
2932
run: |
3033
echo "Next Version: ${{ steps.release.outputs.tag_name }}"
31-
yarn version --new-version ${{ steps.release.outputs.tag_name }}
34+
npm version ${{ steps.release.outputs.tag_name }}
3235
3336
- name: Commit Changes
3437
uses: stefanzweifel/git-auto-commit-action@v4

android/app/build.gradle

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
apply plugin: 'com.android.application'
1+
plugins {
2+
id 'com.android.application'
3+
4+
// See https://github.com/ReactiveCircus/app-versioning
5+
id 'io.github.reactivecircus.app-versioning' version "1.1.2"
6+
}
7+
8+
appVersioning {
9+
gitRootDirectory.set(rootProject.file("../"))
10+
}
211

312
android {
413
compileSdkVersion rootProject.ext.compileSdkVersion

android/build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
32
buildscript {
43

54
repositories {
65
google()
7-
jcenter()
6+
mavenCentral()
7+
gradlePluginPortal()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.1.3'
11-
classpath 'com.google.gms:google-services:4.3.10'
10+
classpath Android.tools.build.gradlePlugin
11+
classpath Google.playServicesGradlePlugin
1212

1313
// NOTE: Do not place your application dependencies here; they belong
1414
// in the individual module build.gradle files
@@ -20,7 +20,8 @@ apply from: "variables.gradle"
2020
allprojects {
2121
repositories {
2222
google()
23-
jcenter()
23+
mavenCentral()
24+
gradlePluginPortal()
2425
}
2526
}
2627

android/lint.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<lint>
3+
<!-- Generated by `./gradlew refreshVersions` to avoid errors when using _ as a version. -->
4+
<issue id="GradlePluginVersion" severity="ignore" />
5+
<issue id="GradleDependency" severity="ignore" />
6+
</lint>

android/settings.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
plugins {
2+
// See https://jmfayard.github.io/refreshVersions
3+
id "de.fayard.refreshVersions" version "0.40.1"
4+
}
5+
16
include ':app'
27
include ':capacitor-cordova-android-plugins'
38
project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/')
49

5-
apply from: 'capacitor.settings.gradle'
10+
apply from: 'capacitor.settings.gradle'

android/variables.gradle

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,4 @@ ext {
22
minSdkVersion = 21
33
compileSdkVersion = 31
44
targetSdkVersion = 31
5-
androidxActivityVersion = '1.2.0'
6-
androidxAppCompatVersion = '1.2.0'
7-
androidxCoordinatorLayoutVersion = '1.1.0'
8-
androidxCoreVersion = '1.3.2'
9-
androidxFragmentVersion = '1.3.0'
10-
junitVersion = '4.13.1'
11-
androidxJunitVersion = '1.1.2'
12-
androidxEspressoCoreVersion = '3.3.0'
13-
cordovaAndroidVersion = '7.0.0'
145
}

android/versions.properties

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#### Dependencies and Plugin versions with their available updates.
2+
#### Generated by `./gradlew refreshVersions` version 0.40.1
3+
####
4+
#### Don't manually edit or split the comments that start with four hashtags (####),
5+
#### they will be overwritten by refreshVersions.
6+
####
7+
#### suppress inspection "SpellCheckingInspection" for whole file
8+
#### suppress inspection "UnusedProperty" for whole file
9+
10+
## unused
11+
version.org.json..json=20140107
12+
13+
## unused
14+
version.org.jacoco..org.jacoco.ant=0.8.3
15+
16+
version.org.apache.cordova..framework=7.0.0
17+
18+
## unused
19+
version.mockito=3.6.28
20+
21+
version.junit.junit=4.13.1
22+
23+
version.com.google.gms..google-services=4.3.10
24+
25+
version.androidx.test.ext.junit=1.1.2
26+
27+
version.androidx.test.espresso=3.3.0
28+
29+
## unused
30+
version.androidx.fragment=1.3.0
31+
32+
## unused
33+
version.androidx.core=1.3.2
34+
35+
## unused
36+
version.androidx.coordinatorlayout=1.1.0
37+
38+
version.androidx.appcompat=1.2.0
39+
40+
## unused
41+
version.androidx.activity=1.2.0
42+
43+
## failed to check repo https://jcenter.bintray.com/ Cause: network or server issue (class java.net.ProtocolException Too many follow-up requests: 21)
44+
plugin.android=7.1.3

0 commit comments

Comments
 (0)