Skip to content

Commit fb7a8d0

Browse files
gitsetiAnja Helmbrecht-Schaar
authored and
Anja Helmbrecht-Schaar
committed
automatically generate release on merge into master (#85)
* automatically generate release on merge into master * Update README.md * Update .travis.yml * Delete .DS_Store
1 parent d4c8f1d commit fb7a8d0

File tree

10 files changed

+48
-30
lines changed

10 files changed

+48
-30
lines changed

.travis.yml

+6-13
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
11
dist: trusty
2-
32
language: java
4-
53
jdk:
64
- oraclejdk8
75
- oraclejdk9
86

97
stages:
108
- test
119
- name: release
12-
if: branch = master && type != pull_request
13-
14-
script: ./gradlew check javadoc
10+
if: type != pull_request && branch = master
1511

1612
jobs:
1713
include:
1814
- stage: release
1915
install: true
20-
script: ./gradlew bintrayUpload -x test
21-
22-
addons:
23-
apt:
24-
packages:
25-
- perl
16+
script: "./gradlew githubRelease"
2617

2718
before_cache:
2819
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
2920
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
21+
3022
cache:
3123
directories:
32-
- $HOME/.gradle/caches/
33-
- $HOME/.gradle/wrapper/
24+
- "$HOME/.gradle/caches/"
25+
- "$HOME/.gradle/wrapper/"
26+

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<img src="01-mqtt-cli.svg" width="500">
44

5-
[![Build Status](https://travis-ci.org/hivemq/01-mqtt-cli.svg?branch=develop)](https://travis-ci.org/hivemq/hivemq-cli)
5+
[![Build Status](https://travis-ci.org/hivemq/01-mqtt-cli.svg?branch=develop)](https://travis-ci.org/hivemq/mqtt-cli)
66

77
MQTT 5.0 and 3.1.1 compatible and feature-rich MQTT Command Line Interface
88

build.gradle

+29-8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ plugins {
1919
id 'edu.sc.seis.launch4j' version '2.4.6'
2020
id 'com.palantir.graal' version '0.6.0'
2121
id 'de.thetaphi.forbiddenapis' version '2.6' apply false
22+
id "com.github.breadmoirai.github-release" version "2.2.9"
2223
}
2324

2425
apply plugin: 'de.thetaphi.forbiddenapis'
@@ -50,7 +51,7 @@ compileTestJava {
5051

5152
group = 'com.hivemq'
5253
version = '1.0.0' + (Boolean.valueOf(System.getProperty("snapshot")) ? "-SNAPSHOT" : "")
53-
description = 'HiveMQ CLI is a tool that provides a feature rich command line interface for connecting, ' +
54+
description = 'MQTT CLI is a tool that provides a feature rich command line interface for connecting, ' +
5455
'publishing, subscribing, unsubscribing and disconnecting ' +
5556
'various MQTT clients simultaneously and supports MQTT 5.0 and MQTT 3.1.1 '
5657

@@ -77,7 +78,7 @@ ext {
7778
readableName = 'mqtt-cli'
7879
appName = 'MQTT CLI'
7980
githubOrg = 'hivemq'
80-
githubRepo = 'hivemq-cli'
81+
githubRepo = 'mqtt-cli'
8182
githubUrl = 'https://github.com/' + githubOrg + '/' + githubRepo
8283
scmConnection = 'scm:git:git://github.com/' + githubOrg + '/' + githubRepo + '.git'
8384
scmDeveloperConnection = 'scm:git:ssh://git@github.com/' + githubOrg + '/' + githubRepo + '.git'
@@ -329,15 +330,15 @@ graal {
329330
task buildPackageBrew(type: Zip) {
330331
dependsOn shadowJar
331332

332-
archiveFileName = project.readableName + '-' + project.version + '-distribution.zip'
333+
archiveFileName = project.readableName + '-' + project.version + '-brew.zip'
333334
destinationDirectory = file(project.buildBrewDir)
334335

335336
from shadowJar.archiveFile
336-
from "$brewDir/mqtt-cli"
337+
from "$brewDir/mqtt"
337338

338339
into('brew') {
339340
from shadowJar.archiveFile
340-
from "$brewDir/mqtt-cli"
341+
from "$brewDir/mqtt"
341342
}
342343

343344
from(projectDir) {
@@ -355,6 +356,7 @@ task buildBrewFormula(type: Copy) {
355356

356357
doLast {
357358
ant.replace(file: "$buildBrewDir/mqtt-cli.rb", token: "@@description@@", value: project.description)
359+
ant.replace(file: "$buildBrewDir/mqtt-cli.rb", token: "@@version@@", value: project.version)
358360
ant.replace(file: "$buildBrewDir/mqtt-cli.rb", token: "@@filename@@", value: buildPackageBrew.archiveFileName.get())
359361
ant.replace(file: "$buildBrewDir/mqtt-cli.rb", token: "@@shasum@@", value: checkSum(buildPackageBrew.archiveFile.get().getAsFile()))
360362
}
@@ -395,15 +397,15 @@ ospackage {
395397
fileType LICENSE
396398
}
397399
from(debDir) {
398-
include 'mqtt-cli'
400+
include 'mqtt'
399401
fileMode 0755
400402
filter {
401403
it.replaceAll("@@jarPath@@", "/opt/${packageName}/${shadowJar.archiveFileName.get()}")
402404
}
403405
}
404406

405407

406-
link('/usr/bin/mqtt-cli', "/opt/$packageName/mqtt-cli", 0755)
408+
link('/usr/bin/mqtt', "/opt/$packageName/mqtt", 0755)
407409

408410
}
409411

@@ -419,11 +421,13 @@ buildRpm {
419421
task buildDebianPackage(type: Copy) {
420422
from buildDeb
421423
into project.buildDebDir
424+
include "*.deb"
422425
}
423426

424427
task buildRpmPackage(type: Copy) {
425428
from buildRpm
426429
into project.buildRpmDir
430+
include "*.rpm"
427431
}
428432

429433
// Windows
@@ -446,7 +450,7 @@ launch4j {
446450
task buildWindowsZip(type: Zip) {
447451
dependsOn createExe
448452

449-
archiveFileName = "${project.readableName}-${project.version}-distribution.zip"
453+
archiveFileName = "${project.readableName}-${project.version}-win.zip"
450454
destinationDirectory = file(project.buildWinDir)
451455

452456
from ("${project.winDir}") {
@@ -465,6 +469,23 @@ task buildPackageAll {
465469
dependsOn buildBrewFormula, buildDebianPackage, buildRpmPackage, buildWindowsZip
466470
}
467471

472+
githubRelease {
473+
token "" + System.getenv("GITHUB_API_TOKEN")
474+
owner = project.githubOrg
475+
targetCommitish "develop"
476+
body ""
477+
draft false
478+
prerelease false
479+
releaseAssets file("${project.buildRpmDir}/${project.readableName}-${project.version}.noarch.rpm"),
480+
file("${project.buildDebDir}/${project.readableName}_${project.version}_all.deb"),
481+
file("${project.buildBrewDir}/${project.readableName}-${project.version}-brew.zip"),
482+
buildWindowsZip
483+
overwrite true
484+
}
485+
486+
487+
tasks.githubRelease.dependsOn tasks.buildPackageAll
488+
468489
// Helpers
469490
import java.security.DigestInputStream
470491
import java.security.MessageDigest

graal/native-image/.DS_Store

-8 KB
Binary file not shown.
File renamed without changes.

packages/homebrew/mqtt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
# Runs Mqtt CLI
3+
exec java -jar ##PREFIX## "$@"

packages/homebrew/mqtt-cli

-3
This file was deleted.

packages/homebrew/mqtt-cli.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
class HivemqCli < Formula
1+
class MqttCli < Formula
22
desc "@@description@@"
33
homepage "https://www.hivemq.com"
4-
url "https://www.hivemq.com/tests/@@filename@@"
4+
url "https://github.com/hivemq/mqtt-cli/releases/download/v@@version@@/@@filename@@"
55
sha256 "@@shasum@@"
66
depends_on :java => "1.8+"
77

88
def install
9-
inreplace "brew/mqtt-cli", "##PREFIX##", "#{prefix}"
10-
prefix.install "mqtt-cli.jar"
11-
bin.install "brew/mqtt-cli"
9+
inreplace "brew/mqtt", "##PREFIX##", "#{prefix}/mqtt-cli-@@version@@.jar"
10+
prefix.install "mqtt-cli-@@version@@.jar"
11+
bin.install "brew/mqtt"
1212
end
1313

1414
test do
File renamed without changes.

packages/windows/README.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
To execute MQTT CLI simply open the Windows Command Prompt with ⊞Win + R and execute cmd.
2+
Navigate into the extracted MQTT CLI folder and execute the mqtt-cli.exe command.
3+
4+
To quick start a MQTT CLI shell simply double-click the mqtt-cli-shell.cmd file.

0 commit comments

Comments
 (0)