First time using Conan to release software
Kien Nguyen Chi
Posted on November 25, 2021
Introduction
This week, I worked on my Static-Site Generator - Potato Generator to add package registry. My SSG is in C++ language. I chose Conan, GitLab, to publish my package officially.
Installation Process
- Firstly, I have to ensure that I have CMake and Conan installed on my machine.
- Secondly, I have to make sure that I create GitLab account, link it to my GitHub's project, create personal access token to access later.
Set-up Process
- I build a package with name and version.
conan new potato-generator/1.0.0 -t
- I build package with user and channel.
conan create . potato-generator/beta
- I add remote to my project (get project_id from GitLab)
conan remote add gitlab https://gitlab.com/api/v4/projects/<project_id>/packages/conan
- I add remote for my instance.
conan remote add gitlab https://gitlab.com/api/v4/packages/conan
- I need to authenticate with my GitLab account. I use username and personal access token from installation step.
conan user <gitlab_username or deploy_token_username> -r gitlab -p <personal_access_token or deploy_token>
- I publish the package.
conan upload potato-generator/1.0.0@potato-generator/beta --all
- Finally, I create a git tag for my first version 1.0.0.
git tag -a v1.0.0 -m "Version 1.0.0"
Install my package instructions
To install my package from Conan, please carefully follow this instructions:
conan install potato-generator --remote=gitlab
- Add remote
conan remote add gitlab https://gitlab.com/api/v4/projects/31616511/packages/conan
Otherwise, please take a look at my Release
💖 💪 🙅 🚩
Kien Nguyen Chi
Posted on November 25, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.