From 7fe30d550ed2b21c09120600a8068e94143ca9cc Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sat, 2 Jul 2022 06:18:52 +0200 Subject: [PATCH 1/2] build: semantic-release (#38) --- .github/workflows/release.yml | 27 ++++++++++----------------- .releaserc | 34 ++++++++++++++++++++++++++++++++++ app/build.gradle | 6 +++--- gradle.properties | 3 ++- 4 files changed, 49 insertions(+), 21 deletions(-) create mode 100644 .releaserc diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 900b2f39a0..40b43d8355 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,9 +5,11 @@ on: push: branches: - main + - dev pull_request: branches: - main + - dev jobs: build: @@ -17,31 +19,22 @@ jobs: uses: styfle/cancel-workflow-action@0.9.0 with: access_token: ${{ secrets.GITHUB_TOKEN }} - - name: Checkout Repo uses: actions/checkout@v3 - - name: Set up JDK 11 uses: actions/setup-java@v3 with: java-version: '11' distribution: 'zulu' - + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: "lts/*" - name: Build with Gradle run: ./gradlew --no-daemon build - - - name: Github Tag Bump - uses: anothrNick/github-tag-action@1.39.0 + - name: Setup semantic-release + run: npm install -g semantic-release @semantic-release/git @semantic-release/changelog gradle-semantic-release-plugin -D + - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WITH_V: true - id: bump_version - - - name: Upload APKs to Release - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ./app/build/outputs/apk/release/*.apk - tag: ${{ steps.bump_version.outputs.new_tag }} - token: ${{ secrets.GITHUB_TOKEN }} - file_glob: true + run: npx semantic-release \ No newline at end of file diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000000..c2baa28e46 --- /dev/null +++ b/.releaserc @@ -0,0 +1,34 @@ +{ + "branches": [ + "main", + { + "name": "dev", + "prerelease": true + } + ], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + "gradle-semantic-release-plugin", + [ + "@semantic-release/git", + { + "assets": [ + "CHANGELOG.md", + "gradle.properties" + ] + } + ], + [ + "@semantic-release/github", + { + "assets": [ + { + "path": "app/build/outputs/apk/release/*.apk" + } + ] + } + ] + ] +} \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index c1ef59da0d..4f49cf585e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -27,13 +27,13 @@ android { } } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } } dependencies { - compileOnly 'androidx.annotation:annotation:1.3.0' + compileOnly 'androidx.annotation:annotation:1.4.0' compileOnly 'androidx.constraintlayout:constraintlayout:2.1.4' } diff --git a/gradle.properties b/gradle.properties index c52ac9b797..770fcd1438 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,4 +16,5 @@ org.gradle.jvmargs=-Xmx2048m # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX -android.enableJetifier=true \ No newline at end of file +android.enableJetifier=true +version = 0.19.0 \ No newline at end of file From 3a2655b38b7e2994ece550ccefadbc70a31f7fa4 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sat, 2 Jul 2022 13:35:37 +0200 Subject: [PATCH 2/2] fix: add missing dummy task `publish` --- build.gradle | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.gradle b/build.gradle index 0a5a862695..0b2ebc644b 100644 --- a/build.gradle +++ b/build.gradle @@ -20,6 +20,12 @@ allprojects { } } +// Tracking issue https://github.com/semantic-release/semantic-release/issues/963 +task publish(type: DefaultTask) { + group = 'publish' + description = 'Dummy publish to pass the verification phase of the gradle-semantic-release-plugin' +} + task clean(type: Delete) { delete rootProject.buildDir } \ No newline at end of file