Skip to content

Instantly share code, notes, and snippets.

@nonelse
Created May 8, 2015 11:20
Show Gist options
  • Save nonelse/01e788c67a3c539e627a to your computer and use it in GitHub Desktop.
Save nonelse/01e788c67a3c539e627a to your computer and use it in GitHub Desktop.
Make New Android Release

Steps to make a new adjust Android release

  1. Make all changes you intend to include in PR.

  2. Do that on SEPARATE branch (not on master).

  3. After you have finished changing source files, make sure that you change all files which contain occurence of current version and to replace those occurences with new version number. In order to check all files which contain occurence of current version (for example v4.0.5) run this command inside repository root folder:

     ag -i 4.0.5
    

    You will get list of files which contain this phrase. Edit each one of them and replace it with new version number (for example 4.0.6).

  4. If you made changes to these files, add it to PR as well.

At this point, you are ready to merge PR into master branch, but we're gonna make preparations for Maven repository update.

  1. Go to folder in repository which contains pom.xml file.

  2. Make sure following two commands execute successfully:

     mvn clean
     mvn package
    

    After you have executed this, you should have your newly generated .jar files in target folder.

  3. Copy your pom.xml file into target folder and rename it to "adjust-android-X.X.X.pom".

  4. Now you need to sign all .jar files and newly copied .pom file. In order to do that, perform following commands:

     gpg -ab adjust-android-X.X.X.jar
     gpg -ab adjust-android-X.X.X-javadoc.jar
     gpg -ab adjust-android-X.X.X-sources.jar
     gpg -ab adjust-android-X.X.X.pom
    

    After you have successfully completed these actions, you will see that you have 4 newly generated files with .asc extension:

     adjust-android-X.X.X.jar.asc
     adjust-android-X.X.X-javadoc.jar.asc
     adjust-android-X.X.X-sources.jar.asc
     adjust-android-X.X.X.pom.asc
    
  5. Now we need to merge all these files into a bundle which we need to upload to Maven repository. In order to do that, perform following command:

     jar -cvf bundle.jar adjust-android-4.0.6.pom adjust-android-4.0.6.pom.asc adjust-android-4.0.6.jar adjust-android-4.0.6.jar.asc adjust-android-4.0.6-javadoc.jar adjust-android-4.0.6-javadoc.jar.asc adjust-android-4.0.6-sources.jar adjust-android-4.0.6-sources.jar.asc
    
     or if you just don't want to type as much:
    
     jar -cvf bundle.jar adjust-android-X.X.X*
    

    After this step you will have bundle.jar in current folder and we can proceed with uploading it to Maven repository.

  6. Go to https://oss.sonatype.org/ and login.

  7. Under Build Promotions on the left, choose Staging Upload.

  8. Choose Artifact Bundle as Upload Mode.

  9. Press Select Bundle to Upload and choose our generated bundle.jar and press Upload Bundle.

Bundle is now in staging and we will release it after we make official release on github page. Back to github and console line!

  1. Merge your PR into master!

  2. Checkout master branch and rebase.

  3. Add the tag for new version. In order to do that, perform following command: git tag -a v4.0.6 -m "Version v4.0.6"

  4. Push tag to remote repository! In order to do that, perform following command: git push origin --tags

  5. Go to github releases page and Draft a new release! Write down the title, what's new in it and which PRs are linked to it.

  6. Choose to add files to new release and attach following two files: adjust-android-X.X.X-sources.jar adjust-android-X.X.X.jar

  7. Release it!

Ole! Now go back to sonatype panel and make new Maven release!

  1. Under Build Promotion choose Staging Repositories. Sort them by date, or how ever you want, but just find the newest one which is in staging state.

  2. Select it and choose Release!

That's all folks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment