Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
Add script to publish version
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoconti83 committed Aug 8, 2019
1 parent 18d472d commit 31df406
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 9 deletions.
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,7 @@ mvn install:install-file \
```

#### Bintray
In order to publish the binary to Bintray, you need to install the JFrog CLI (`jfrog-cli-go`) tool.

- Create a version using `jfrog` CLI
- Upload files to that version using the `jfrog` CLI. E.g:
```
/usr/local/bin/jfrog bt u "cryptobox-android-1.1.1.*" \
"wire-android/releases/cryptobox-android/1.1.1" \
"com/wire/cryptobox-android/1.1.1/"
```
In order to publish the binary to Bintray, you need to install the JFrog CLI (`jfrog-cli-go`), configure the credentials and then run `publish.sh`

## Sample Application

Expand Down
21 changes: 21 additions & 0 deletions TEMPLATE.pom
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version='1.0' encoding='UTF-8'?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wire</groupId>
<artifactId>cryptobox-android</artifactId>
<packaging>aar</packaging>
<description>cryptobox-android</description>
<version>%%VERSION%%</version>
<packaging>aar</packaging>
<licenses>
<license>
<name>GPL-3.0</name>
<url>https://opensource.org/licenses/GPL-3.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<name>cryptobox-android</name>
<organization>
<name>com.wire</name>
</organization>
</project>
29 changes: 29 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

set -e

VERSION_FILE="mk/version.mk"
CBOX_VERSION=`grep VERSION ${VERSION_FILE} | sed 's/VERSION\ := \(.*\)/\1/' | sed 's/\s//'`
if [[ $CBOX_VERSION =~ ^[0-9]\.[0-9]\.[0-9]$ ]]; then
echo "Version from '${VERSION_FILE}' is: ${CBOX_VERSION}"
else
>&2 echo "Can't parse version in ${VERSION_FILE}"
exit 1
fi

# Create POM file
sed s/%%VERSION%%/${CBOX_VERSION}/ TEMPLATE.pom > output/dist/cryptobox-android-${CBOX_VERSION}.pom

# Create version
jfrog bt vc wire-android/releases/cryptobox-android/${CBOX_VERSION}
# Upload files
jfrog bt u "output/dist/cryptobox-android-${CBOX_VERSION}.aar" \
"wire-android/releases/cryptobox-android/${CBOX_VERSION}" \
"com/wire/cryptobox-android/${CBOX_VERSION}/"
jfrog bt u "output/dist/cryptobox-android-${CBOX_VERSION}.pom" \
"wire-android/releases/cryptobox-android/${CBOX_VERSION}" \
"com/wire/cryptobox-android/${CBOX_VERSION}/"
# Publish
jfrog bt vp wire-android/releases/cryptobox-android/${CBOX_VERSION}

echo "Version ${CBOX_VERSION} uploaded!"

0 comments on commit 31df406

Please sign in to comment.