@@ -158,66 +158,97 @@ These bundled dependencies may be migrated to Conan in the future.
158158
159159## Publishing to Conan Center
160160
161- ### Prerequisites
161+ The package is published to [ Conan Center ] ( https://conan.io/center ) via pull requests to the [ conan-center-index ] ( https://github.com/conan-io/conan-center-index ) repository. The recipe is maintained at ` recipes/influxdb-cpp-rest/ ` in that repository.
162162
163- 1 . Conan 2.0+
164- 2 . Conan account at https://conan.io/
165- 3 . GitHub repository (public)
163+ ### Initial Setup (One-time)
166164
167- ### Publishing Steps
165+ 1 . Fork https://github.com/conan-io/conan-center-index
166+ 2 . Clone your fork locally
167+ 3 . Set upstream remote: ` git remote add upstream https://github.com/conan-io/conan-center-index.git `
168168
169- 1 . ** Update version in conanfile.py **
169+ ### Publishing a New Version
170170
171- Update the ` version ` field in ` conanfile.py ` :
172- ``` python
173- version = " 1.0.0" # or your new version
174- ```
175-
176- 2 . ** Create Conan recipe (if not exists)**
171+ Use the automated script (recommended):
177172
178- The ` conanfile.py ` should export all necessary files and define requirements.
173+ ``` bash
174+ ./scripts/publish-conan-version.sh 1.0.0
175+ ```
179176
180- 3 . ** Test the recipe locally **
177+ Or manually:
181178
179+ 1 . ** Create a GitHub release/tag** for the version (if not already exists)
180+ 2 . ** Navigate to conan-center-index repository** :
182181 ``` bash
183- conan create . --version 1.0.0
182+ cd ../conan-center-index # or wherever you cloned it
183+ git checkout master
184+ git pull upstream master
184185 ```
185-
186- Test with different configurations:
186+ 3 . ** Create version branch** :
187+ ``` bash
188+ git checkout -b recipes/influxdb-cpp-rest/X.Y.Z
189+ ```
190+ 4 . ** Create recipe directory and files** :
187191 ``` bash
188- conan create . --version 1.0.0 -s compiler=gcc -s compiler.version=11
189- conan create . --version 1.0.0 -s compiler=clang -s compiler.version=14
192+ mkdir -p recipes/influxdb-cpp-rest/X.Y.Z
193+ # Copy conanfile.py template and adapt for conan-center-index format
194+ # Create conandata.yml with source URL and SHA256
195+ ```
196+ 5 . ** Commit and push** :
197+ ``` bash
198+ git add recipes/influxdb-cpp-rest/X.Y.Z/
199+ git commit -m " Add influxdb-cpp-rest/X.Y.Z"
200+ git push origin recipes/influxdb-cpp-rest/X.Y.Z
201+ ```
202+ 6 . ** Create pull request** :
203+ ``` bash
204+ gh pr create --repo conan-io/conan-center-index --title " Add influxdb-cpp-rest/X.Y.Z"
190205 ```
191206
192- 4 . ** Export recipe **
207+ See [ Publishing New Versions ] ( #publishing-new-versions ) section below for details.
193208
209+ ## Publishing New Versions
210+
211+ When releasing a new version of influxdb-cpp-rest:
212+
213+ 1 . ** Create and push a Git tag** (e.g., ` v1.0.0 ` ):
194214 ``` bash
195- conan export . --version 1.0.0
215+ ./scripts/tag-version.sh patch # or major/minor
216+ git push --tags
196217 ```
197218
198- 5 . ** Upload to Conan Center**
219+ 2 . ** Automatic publishing** : Pushing a tag starting with ` v ` (e.g., ` v1.0.0 ` ) automatically triggers the GitHub Actions workflow that:
220+ - Calculates the SHA256 hash of the source tarball
221+ - Creates the recipe files in the correct format
222+ - Commits and pushes to your conan-center-index fork
223+ - Creates a pull request to conan-center-index
199224
200- First, create a pull request to Conan Center Index:
201-
202- - Fork https://github.com/conan-io/conan-center-index
203- - Create branch: ` recipes/influxdb-cpp-rest/x.y.z ` (where x.y.z is version)
204- - Copy your ` conanfile.py ` to ` recipes/influxdb-cpp-rest/x.y.z/conanfile.py `
205- - Add recipe files to the index repository
206- - Open a pull request
225+ 3 . ** Monitor the PR** : The Conan Center CI will automatically test the recipe. Address any review comments or CI failures.
207226
208- The Conan Center team will review and merge your recipe.
227+ ### Manual Publishing (Alternative)
209228
210- 6 . ** Alternative: Upload to your own remote **
229+ If you need to publish manually or the automated workflow fails:
211230
212- If you want to publish to your own Conan remote:
213-
214- ``` bash
215- # Add your remote
216- conan remote add myremote https://your-conan-server.com
217-
218- # Upload
219- conan upload influxdb-cpp-rest/1.0.0 -r myremote --all
220- ```
231+ ``` bash
232+ ./scripts/publish-conan-version.sh 1.0.0
233+ ```
234+
235+ This script will:
236+ - Clone/update your conan-center-index fork if needed
237+ - Calculate the SHA256 hash of the source tarball
238+ - Create the recipe files in the correct format
239+ - Commit and push the changes
240+ - Create a pull request to conan-center-index
241+
242+ ### Recipe Format for Conan Center
243+
244+ The recipe in conan-center-index differs from the local ` conanfile.py ` :
245+
246+ - ** No ` version ` field** - version comes from directory path
247+ - ** ` source() ` method** - downloads from GitHub release/tag
248+ - ** ` conandata.yml ` ** - contains source URL and SHA256 checksum
249+ - ** No ` exports_sources ` ** - source is downloaded, not exported
250+
251+ The automation script handles these differences automatically.
221252
222253### Conan Recipe Checklist
223254
@@ -229,13 +260,24 @@ These bundled dependencies may be migrated to Conan in the future.
229260- [ ] Compatible with major compilers (GCC, Clang, MSVC)
230261- [ ] Works on Linux, macOS, Windows
231262
263+ ### Testing Locally
264+
265+ Before publishing, test the recipe locally:
266+
267+ ``` bash
268+ # In your conan-center-index fork
269+ cd recipes/influxdb-cpp-rest/1.0.0
270+ conan create . influxdb-cpp-rest/1.0.0@
271+ ```
272+
232273### Conan Center Requirements
233274
234275- Recipe must be in conan-center-index repository
235276- Must pass automated CI checks
236277- All dependencies must also be in Conan Center
237278- License must be compatible with Conan Center
238279- Source code must be publicly accessible
280+ - GitHub tag/release must exist for the version
239281
240282### Versioning
241283
0 commit comments