-
Notifications
You must be signed in to change notification settings - Fork 11
Release conda packages via cmi release
- Copy or move the
cmi-release
bash script to aPATH
directory, for example/usr/local/bin/
. To view allPATH
, run:
echo $PATH
- Change to the path directory from the previous step and change the permission of
cmi-release
in order to run it as executable:
cd /usr/local/bin
chmod +x cmi-release
Check if you can run cmi-release
by typing:
cmi-release --help
It should give you a list of options that you can run cmi-release
.
-
Fork one of the diffpy packages (for example
diffpy.utils
) to your github and clone it to your local working directory. Do not fork and clonediffpy-release
. -
cd
to the cloned directory and check out a new branch. -
Run the following command to see the version suggested for the package:
cmi-release tagmessage
This message should show up:
Release X.X.X
See CHANGELOG.md for detailed release notes.
where X.X.X
is the suggested version.
Run the following command to write the above messsage to a msg
file:
cmi-release tagmessage >> msg
- Install
gpg
if you don't have it already. On macOS, you can usebrew
:
brew install gpg
or alternatively, you can install from source here.
-
Follow the instructions in this link to add a GPG key to your github account.
-
Run
git tag --sign --file=msg vX.X.X
Replace X.X.X
with the version you want to release.
Should it fail to tag, try the following things:
- Check if your username and email on the key and
git
on your machine are consistent with your github username and email. To check the git username and email on your machine, use:
git config --global user.name
git config --global user.email
If these are not your gihub username and email, change them by running:
git config --global user.name <github-username>
git config --global user.email <github-email>
where github-username
and github-email
are your github username and email with quotation marks, i.e. "abc123"
.
For your GPG key, the name and email should have been supplied in the previous step. In order to check and change the name, see instructions here.
- If the above steps are done and you still have errors tagging, try reinstalling GPG using the following instructions and retry step 7 and 8.
brew uninstall gpg
brew install gpg2
brew install pinentry-mac
# optional
gpgconf --kill gpg-agent
- Push your tag to github:
git push origin <tag>
This tag should be the same tag in step 8. To check all the tag, run git tag -l
.
Check your release on your Github repo on web. It should show a your new release with the green "Verified" button next to it to confirm that your GPG key was added correctly. For an example, see here.
- Build the conda package:
cmi-release conda-build <path-to-recipe>
where path-to-recipe
is the path to the conda recipes inside your cloned directory.
-
Check how many packages conda has produced in step 10. The packages are stored in the
conda-bld
directory in where Anaconda was installed (i.e./anaconda3/conda-bld/osx-64/
on macOS) -
Upload the package to conda cloud. Frist, upload your package to the private dev channel so it can be tested before releasing to the public. To upload the n-th newest conda package to the dev channel, where n is the number of packages found in step 11, run:
cmi-release dev upload -1 -2 -3 ...
For examples, if conda build produces 4 packages, use cmi-release dev upload -1 -2 -3 -4
.
It'll ask for your conda username and password for this step. If you don't have a Anaconda account, make one at https://anaconda.org/. If you want to upload to the diffpy dev channel, you need to be added to the diffpy organization. Contact Simon to do so.
- Test your release by installing the newly uploaded package:
conda install -c diffpy/label/dev <package-name>
-
If the test passes, upload your package to the public conda cloud by running the same command in step 12 without the dev label.
-
Finally, run
cmi-release github
to see a suggested release description for Github.