Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release job #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release

on:
push:
tags:
- '*'

jobs:
publish:
name: Publish release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Install JDK ${{ matrix.java_version }}
uses: actions/setup-java@v1
with:
java-version: 8
- name: Build project
run: ./gradlew build
env:
VERSION: ${{ github.ref }}
- name: Find Tag
id: tagger
uses: jimschubert/query-tag-action@v2
with:
skip-unshallow: 'true'
commit-ish: HEAD
- run: |
PRE_RELEASE=""
string='My long string'
if [[ ${{steps.tagger.outputs.tag}} == *"beta"* ]]; then
PRE_RELEASE="-p"
fi
if [[ ${{steps.tagger.outputs.tag}} == *"alpha"* ]]; then
PRE_RELEASE="-p"
fi
assets=$(find . -name "*${{steps.tagger.outputs.tag}}*.jar" -or -name " *release.aar" | while read -r asset ; do echo "-a $asset" ; done)
set -x
hub release create $PRE_RELEASE ${assets} -m "${{steps.tagger.outputs.tag}}" "${{steps.tagger.outputs.tag}}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{steps.tagger.outputs.tag}}
# - name: Publish ${{steps.tagger.outputs.tag}}
# uses: burrunan/[email protected]
# with:
# remote-build-cache-proxy-enabled: false
# properties: |
# gradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }}
# gradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}
# arguments: publishPlugins -s --scan
187 changes: 104 additions & 83 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
buildscript {
// Executed in context of buildscript
repositories {
// mavenLocal()
mavenCentral()
// jcenter()
// maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
gradlePluginPortal()
}

dependencies {
classpath 'org.anarres.gradle:gradle-stdproject-plugin:1.0.10'
}
// Executed in context of buildscript
repositories {
// mavenLocal()
mavenCentral()
// jcenter()
// maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
gradlePluginPortal()
}

dependencies {
classpath 'org.anarres.gradle:gradle-stdproject-plugin:1.0.10'
}
}


Expand All @@ -19,94 +19,115 @@ stdproject {
}

subprojects {
version = '1.1.1'
apply plugin: 'org.anarres.stdmodule'
apply plugin: 'eclipse'
stdmodule {
description "Jar Jar Links is a utility that makes it easy to repackage Java libraries and embed them into your own distribution."
author id: 'shevek', name: 'Shevek', email: '[email protected]'
license 'Apache-2.0'
}

group = "org.anarres.jarjar"

dependencies {
compile 'com.google.code.findbugs:annotations:3.0.1'
compile 'org.slf4j:slf4j-api:1.7.12'
}

sourceCompatibility = 1.7
version = getTag()
apply plugin: 'org.anarres.stdmodule'
apply plugin: 'eclipse'
stdmodule {
description "Jar Jar Links is a utility that makes it easy to repackage Java libraries and embed them into your own distribution."
author id: 'shevek', name: 'Shevek', email: '[email protected]'
license 'Apache-2.0'
}

group = "org.anarres.jarjar"

dependencies {
compile 'com.google.code.findbugs:annotations:3.0.1'
compile 'org.slf4j:slf4j-api:1.7.12'
}

sourceCompatibility = 1.7
}

version = '1.1.1'
version = getTag()

project(':jarjar-testdata') {
dependencies {
compile 'com.google.guava:guava:17.0'
}

for (int i = 0; i < 4; i++) {
String name = "jar$i";
Task t = task(name, type: Jar) {
classifier = name
from(sourceSets.main.output) {
include "**/pkg$i/**";
}
}

artifacts {
archives t
}
}

uploadArchives.enabled = false
dependencies {
compile 'com.google.guava:guava:17.0'
}

for (int i = 0; i < 4; i++) {
String name = "jar$i";
Task t = task(name, type: Jar) {
classifier = name
from(sourceSets.main.output) {
include "**/pkg$i/**";
}
}

artifacts {
archives t
}
}

uploadArchives.enabled = false
}

project(':jarjar-core') {
dependencies {
compile 'org.ow2.asm:asm-commons:8.0.1'
compile 'org.ow2.asm:asm-util:8.0.1'
// compile 'org.ow2.asm:asm-commons:4.0'

// testCompile project(':jarjar-testdata')
}

def samplesProject = project(':jarjar-testdata')
test.dependsOn samplesProject.tasks['assemble']
test {
systemProperty "jar", samplesProject.jar.archivePath
for (int i = 0; i < 4; i++) {
systemProperty "jar$i", samplesProject."jar$i".archivePath
}
}
dependencies {
compile 'org.ow2.asm:asm-commons:8.0.1'
compile 'org.ow2.asm:asm-util:8.0.1'
// compile 'org.ow2.asm:asm-commons:4.0'

// testCompile project(':jarjar-testdata')
}

def samplesProject = project(':jarjar-testdata')
test.dependsOn samplesProject.tasks['assemble']
test {
systemProperty "jar", samplesProject.jar.archivePath
for (int i = 0; i < 4; i++) {
systemProperty "jar$i", samplesProject."jar$i".archivePath
}
}
}

project(':jarjar-gradle') {
apply plugin: 'org.anarres.stdplugin'
apply plugin: 'org.anarres.stdplugin'

stdplugin {
implementation "org.anarres.jarjar", "org.anarres.gradle.plugin.jarjar.JarjarPlugin"
}
stdplugin {
implementation "org.anarres.jarjar", "org.anarres.gradle.plugin.jarjar.JarjarPlugin"
}

dependencies {
compile project(':jarjar-core')
compile 'org.apache.commons:commons-compress:1.9'
compile gradleApi()
compile 'oro:oro:2.0.8'
dependencies {
compile project(':jarjar-core')
compile 'org.apache.commons:commons-compress:1.9'
compile gradleApi()
compile 'oro:oro:2.0.8'

testCompile project(':jarjar-core').sourceSets.test.output
}
testCompile project(':jarjar-core').sourceSets.test.output
}
}

project(':jarjar-command') {
dependencies {
compile project(':jarjar-core')
compile 'net.sf.jopt-simple:jopt-simple:4.8'
dependencies {
compile project(':jarjar-core')
compile 'net.sf.jopt-simple:jopt-simple:4.8'

testCompile project(':jarjar-core').sourceSets.test.output
}
testCompile project(':jarjar-core').sourceSets.test.output
}

apply plugin: 'application'
apply plugin: 'application'

mainClassName = "com.tonicsystems.jarjar.Main"
mainClassName = "com.tonicsystems.jarjar.Main"
}

static def getTag() {
def tagVersion = "$System.env.VERSION"
if (tagVersion == "null") {
// with local un-commited changes a -DIRTY is added
def processChanges = "git diff-index --name-only HEAD --".execute()
def dirty = ""
if (!processChanges.text.toString().trim().isEmpty())
dirty = "-DIRTY"

def process = "git describe --tags".execute()
tagVersion = process.text.toString().trim() + dirty
} else {
def tagVersionToken = tagVersion.split("/")
if (tagVersionToken.size() > 2)
tagVersion = tagVersionToken[2]
else
tagVersion = tagVersionToken[0]
}
return tagVersion
}