提交 156e4209 编写于 作者: S Skylot

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

上级 7492889f
...@@ -18,6 +18,7 @@ build/ ...@@ -18,6 +18,7 @@ build/
classes/ classes/
idea/ idea/
.gradle/ .gradle/
node_modules/
jadx-output/ jadx-output/
*-tmp/ *-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 ...@@ -2,6 +2,12 @@ language: java
sudo: false sudo: false
dist: trusty dist: trusty
# don't build on tag push
if: tag IS blank
git:
depth: false
before_install: before_install:
- wget https://github.com/sormuras/bach/raw/master/install-jdk.sh - wget https://github.com/sormuras/bach/raw/master/install-jdk.sh
- chmod +x gradlew - chmod +x gradlew
...@@ -9,6 +15,7 @@ before_install: ...@@ -9,6 +15,7 @@ before_install:
env: env:
global: global:
- TERM=dumb - TERM=dumb
- JADX_VERSION="$(git describe --abbrev=0 --tags)-b$TRAVIS_BUILD_NUMBER-$(git rev-parse --short HEAD)"
matrix: matrix:
include: include:
...@@ -19,30 +26,24 @@ matrix: ...@@ -19,30 +26,24 @@ matrix:
script: script:
- java -version - 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 - ./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: deploy:
provider: bintray - provider: script
edge: skip_cleanup: true
branch: v1.8.47 on:
file: bintray.json branch: master
user: skylot tags: false
key: $BINTRAY_KEY condition: $JDK = oracle-8
skip_cleanup: true script: bash scripts/travis-master.sh
on:
branch: master - provider: script
tags: false skip_cleanup: true
condition: $JDK = oracle-8 on:
branch: release
tags: false
condition: $JDK = oracle-8
script: bash scripts/travis-release.sh
notifications: notifications:
email: email:
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
[![Code Coverage](https://codecov.io/gh/skylot/jadx/branch/master/graph/badge.svg)](https://codecov.io/gh/skylot/jadx) [![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) [![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) [![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 **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 { ...@@ -4,8 +4,9 @@ plugins {
id 'com.github.ben-manes.versions' version '0.20.0' 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 version = jadxVersion
println("jadx version: ${jadxVersion}")
allprojects { allprojects {
apply plugin: 'java' 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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册