Skip to content

Commit 67a68df

Browse files
committed
F Automate the testing of the Conan steps
1 parent aae7306 commit 67a68df

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

build/HowToRelease.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,4 @@ You will need to:
4040
* Create a branch for the patch
4141
* Edit [build/release_details.py](/build/release_details.py) to give the relative path to your cloned fork
4242
* Run the release process as normal - this appends lines for your new release to your copy of `conandata.yml`
43-
* Test the edit: **WHERE YOU MANUALLY PUT IN THE NEW VERSION NUMBER**
44-
```bash
45-
cd conan-center-index/recipes/approvaltests.cpp/all
46-
conan create . 8.1.1@
47-
```
48-
* Submit a pull request
43+
* The 'deploy' step will test the changes, and prompt you to submit a pull request

build/deploy_release.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import pyperclip
55

6+
import version
67
from utilities import read_file, check_step, run, pushdir, popdir
78
from prepare_release import PrepareRelease
89

@@ -39,6 +40,14 @@ def push_main_project(self):
3940
run(["git", "push", "origin", "master"])
4041
popdir()
4142

43+
def test_conan_and_create_pr(self):
44+
pushdir(self.details.conan_data_dir)
45+
new_version_without_v = version.get_version_without_v(self.details.new_version)
46+
run(F'conan create . {new_version_without_v}@')
47+
popdir()
48+
49+
check_step("that you have created a Pull Request for conan-center-index?")
50+
4251
def publish_main_project(self):
4352
self.commit_main_project()
4453
self.push_main_project()
@@ -52,7 +61,7 @@ def publish_main_project(self):
5261
run(["open", self.details.release_dir])
5362
check_step("that the release is published")
5463

55-
check_step("that you have created a Pull Request for conan-center-index?")
64+
self.test_conan_and_create_pr()
5665

5766
# Draft the tweet
5867
check_step("that you have created a screenshot of the release notes, for the Tweet")
@@ -63,7 +72,6 @@ def publish_main_project(self):
6372
run(["open", "https://www.reddit.com/r/cpp/"])
6473
check_step("if you want to announce this on Reddit r/cpp")
6574

66-
6775
def push_everything_live(self):
6876
self.publish_main_project()
6977
self.publish_starter_project()

build/release_details.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def __init__(self, old_version, new_version, publish_release):
3131
self.release_new_single_header = F"{self.release_dir}/{self.new_single_header}"
3232

3333
self.conan_repo_dir = '../../../conan/conan-center-index-claremacrae'
34-
self.conan_data_file = os.path.join(self.conan_repo_dir, 'recipes', 'approvaltests.cpp', 'all', 'conandata.yml')
34+
self.conan_data_dir = os.path.join(self.conan_repo_dir, 'recipes', 'approvaltests.cpp', 'all')
35+
self.conan_data_file = os.path.join(self.conan_data_dir, 'conandata.yml')
3536

3637
self.main_project_dir = F"../../ApprovalTests.Cpp"
3738
self.starter_project_dir = F"../../ApprovalTests.Cpp.StarterProject"

0 commit comments

Comments
 (0)