diff --git a/.gitignore b/.gitignore index 902e0fea2bd..4627d8fad72 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ build/ classes/ idea/ .gradle/ +node_modules/ jadx-output/ *-tmp/ diff --git a/.releaserc.yml b/.releaserc.yml new file mode 100644 index 00000000000..a3891f5cb57 --- /dev/null +++ b/.releaserc.yml @@ -0,0 +1,16 @@ +branch: release +verifyConditions: + - '@semantic-release/github' +prepare: + - path: '@semantic-release/exec' + cmd: "JADX_VERSION=${nextRelease.version} ./gradlew clean dist" +publish: + - path: '@semantic-release/exec' + cmd: "JADX_VERSION=${nextRelease.version} BINTRAY_PACKAGE=releases bash scripts/bintray-upload.sh" + - path: '@semantic-release/github' + assets: + - path: 'build/*.zip' + label: 'zip bundle' + - path: 'build/*.exe' + label: 'jadx-gui windows' + diff --git a/.travis.yml b/.travis.yml index 7087a01dc85..b50f631357f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,12 @@ language: java sudo: false dist: trusty +# don't build on tag push +if: tag IS blank + +git: + depth: false + before_install: - wget https://github.com/sormuras/bach/raw/master/install-jdk.sh - chmod +x gradlew @@ -9,6 +15,7 @@ before_install: env: global: - TERM=dumb + - JADX_VERSION="$(git describe --abbrev=0 --tags)-b$TRAVIS_BUILD_NUMBER-$(git rev-parse --short HEAD)" matrix: include: @@ -19,30 +26,24 @@ matrix: script: - java -version - - sed -i " 1 s/.*/&-b$TRAVIS_BUILD_NUMBER-$(git rev-parse --short HEAD)/" version - - cat version - - sed -i "s/BUILD_VERSION/$(head -c -1 version)/g" bintray.json - ./gradlew clean build -after_success: - - test $JDK = "oracle-8" && ./gradlew clean build jacocoTestReport && bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" - - test $JDK = "oracle-8" && ./gradlew clean sonarqube -Dsonar.host.url=$SONAR_HOST -Dsonar.organization=$SONAR_ORG -Dsonar.login=$SONAR_TOKEN || echo "Skip sonar build and upload" - -before_deploy: - - ./gradlew clean dist - deploy: - provider: bintray - edge: - branch: v1.8.47 - file: bintray.json - user: skylot - key: $BINTRAY_KEY - skip_cleanup: true - on: - branch: master - tags: false - condition: $JDK = oracle-8 + - provider: script + skip_cleanup: true + on: + branch: master + tags: false + condition: $JDK = oracle-8 + script: bash scripts/travis-master.sh + + - provider: script + skip_cleanup: true + on: + branch: release + tags: false + condition: $JDK = oracle-8 + script: bash scripts/travis-release.sh notifications: email: diff --git a/README.md b/README.md index c254948d2c2..387710a3cd5 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![Code Coverage](https://codecov.io/gh/skylot/jadx/branch/master/graph/badge.svg)](https://codecov.io/gh/skylot/jadx) [![SonarQube Bugs](https://sonarcloud.io/api/project_badges/measure?project=jadx&metric=bugs)](https://sonarcloud.io/dashboard?id=jadx) [![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) +[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) **jadx** - Dex to Java decompiler diff --git a/bintray.json b/bintray.json deleted file mode 100644 index a8e43679651..00000000000 --- a/bintray.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "package": { - "name": "unstable", - "repo": "jadx", - "subject": "skylot", - "desc": "Unstable", - "website_url": "https://github.com/skylot/jadx", - "issue_tracker_url": "https://github.com/skylot/jadx/issues", - "vcs_url": "https://github.com/skylot/jadx.git", - "licenses": [ - "Apache-2.0" - ], - "labels": [ - "unstable" - ], - "public_download_numbers": true, - "public_stats": true - }, - "version": { - "name": "BUILD_VERSION", - "desc": "Dev build: BUILD_VERSION" - }, - "files": [ - { - "includePattern": "build/(jadx.*\.(zip|exe))", - "uploadPattern": "$1", - "matrixParams": { - "override": 1 - }, - "list_in_downloads": true - } - ], - "publish": true -} diff --git a/build.gradle b/build.gradle index 919cdd619a8..292e4486712 100644 --- a/build.gradle +++ b/build.gradle @@ -4,8 +4,9 @@ plugins { id 'com.github.ben-manes.versions' version '0.20.0' } -ext.jadxVersion = file('version').readLines().get(0) +ext.jadxVersion = System.getenv('JADX_VERSION') ?: "dev" version = jadxVersion +println("jadx version: ${jadxVersion}") allprojects { apply plugin: 'java' diff --git a/scripts/bintray-upload.sh b/scripts/bintray-upload.sh new file mode 100644 index 00000000000..3a6a35783ee --- /dev/null +++ b/scripts/bintray-upload.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -xe + +export JFROG_CLI_OFFER_CONFIG=false +export JFROG_CLI_LOG_LEVEL=DEBUG + +npm install -g jfrog-cli-go + +TARGET=skylot/jadx/${BINTRAY_PACKAGE}/v${JADX_VERSION} +CREDENTIALS="--user=skylot --key=${BINTRAY_KEY}" + +jfrog bt version-create ${TARGET} ${CREDENTIALS} --desc=${JADX_VERSION} +jfrog bt upload 'build/jadx.*\.(zip|exe)' ${TARGET} ${CREDENTIALS} --regexp=true --publish=true +jfrog bt version-publish ${TARGET} ${CREDENTIALS} diff --git a/scripts/travis-master.sh b/scripts/travis-master.sh new file mode 100644 index 00000000000..75c7b0da0c9 --- /dev/null +++ b/scripts/travis-master.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -xe + +# upload coverage to codecov +./gradlew clean build jacocoTestReport +bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" + +# run sonar checks +./gradlew clean sonarqube -Dsonar.host.url=${SONAR_HOST} -Dsonar.organization=${SONAR_ORG} -Dsonar.login=${SONAR_TOKEN} || echo "Skip sonar build and upload" + +# upload bundles to bintray unstable package +./gradlew clean dist +BINTRAY_PACKAGE=unstable bash scripts/bintray-upload.sh diff --git a/scripts/travis-release.sh b/scripts/travis-release.sh new file mode 100644 index 00000000000..bdad6ef2f0a --- /dev/null +++ b/scripts/travis-release.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -xe + +npm install -g semantic-release +npm install -g semantic-release/exec +semantic-release diff --git a/version b/version deleted file mode 100644 index 7ad524af24a..00000000000 --- a/version +++ /dev/null @@ -1 +0,0 @@ -0.7.2-unstable