Commit 156e4209 authored by Skylot's avatar Skylot

feat(build): use semantic-release for automatic release publishing

parent 7492889f
......@@ -18,6 +18,7 @@ build/
classes/
idea/
.gradle/
node_modules/
jadx-output/
*-tmp/
......
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'
......@@ -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:
......
......@@ -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
......
{
"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
}
......@@ -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'
......
#!/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}
#!/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
#!/usr/bin/env bash
set -xe
npm install -g semantic-release
npm install -g semantic-release/exec
semantic-release
0.7.2-unstable
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment