Skip to content

Commit

Permalink
F Automate the testing of the Conan steps
Browse files Browse the repository at this point in the history
  • Loading branch information
claremacrae committed Feb 4, 2020
1 parent aae7306 commit 67a68df
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
7 changes: 1 addition & 6 deletions build/HowToRelease.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,4 @@ You will need to:
* Create a branch for the patch
* Edit [build/release_details.py](/build/release_details.py) to give the relative path to your cloned fork
* Run the release process as normal - this appends lines for your new release to your copy of `conandata.yml`
* Test the edit: **WHERE YOU MANUALLY PUT IN THE NEW VERSION NUMBER**
```bash
cd conan-center-index/recipes/approvaltests.cpp/all
conan create . 8.1.1@
```
* Submit a pull request
* The 'deploy' step will test the changes, and prompt you to submit a pull request
12 changes: 10 additions & 2 deletions build/deploy_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import pyperclip

import version
from utilities import read_file, check_step, run, pushdir, popdir
from prepare_release import PrepareRelease

Expand Down Expand Up @@ -39,6 +40,14 @@ def push_main_project(self):
run(["git", "push", "origin", "master"])
popdir()

def test_conan_and_create_pr(self):
pushdir(self.details.conan_data_dir)
new_version_without_v = version.get_version_without_v(self.details.new_version)
run(F'conan create . {new_version_without_v}@')
popdir()

check_step("that you have created a Pull Request for conan-center-index?")

def publish_main_project(self):
self.commit_main_project()
self.push_main_project()
Expand All @@ -52,7 +61,7 @@ def publish_main_project(self):
run(["open", self.details.release_dir])
check_step("that the release is published")

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

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


def push_everything_live(self):
self.publish_main_project()
self.publish_starter_project()
3 changes: 2 additions & 1 deletion build/release_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def __init__(self, old_version, new_version, publish_release):
self.release_new_single_header = F"{self.release_dir}/{self.new_single_header}"

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

self.main_project_dir = F"../../ApprovalTests.Cpp"
self.starter_project_dir = F"../../ApprovalTests.Cpp.StarterProject"
Expand Down

0 comments on commit 67a68df

Please sign in to comment.