DEV Community

Kien Nguyen Chi
Kien Nguyen Chi

Posted on

First time using Conan to release software

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
Enter fullscreen mode Exit fullscreen mode
  • I build package with user and channel.
conan create . potato-generator/beta
Enter fullscreen mode Exit fullscreen mode
  • 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
Enter fullscreen mode Exit fullscreen mode
  • I add remote for my instance.
conan remote add gitlab https://gitlab.com/api/v4/packages/conan
Enter fullscreen mode Exit fullscreen mode
  • 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>
Enter fullscreen mode Exit fullscreen mode
  • I publish the package.
conan upload potato-generator/1.0.0@potato-generator/beta --all
Enter fullscreen mode Exit fullscreen mode
  • Finally, I create a git tag for my first version 1.0.0.
git tag -a v1.0.0 -m "Version 1.0.0"
Enter fullscreen mode Exit fullscreen mode

Install my package instructions

To install my package from Conan, please carefully follow this instructions:

  • Install Conan and CMake
  • Install package by Conan command
conan install potato-generator --remote=gitlab
Enter fullscreen mode Exit fullscreen mode
  • Add remote
conan remote add gitlab https://gitlab.com/api/v4/projects/31616511/packages/conan
Enter fullscreen mode Exit fullscreen mode

Otherwise, please take a look at my Release

Top comments (0)