Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 0 additions & 59 deletions .github/workflows/conan-center.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,8 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python -m pip install 'conan>=2.12,<3'
- run: conan profile detect --force
- name: Verify version and archive the tested commit
run: python tools/release.py --project libtxms --tag "$TAG"
- name: Prepare and test the ConanCenter download recipe
run: |
version="${TAG}"
python tools/prepare_conan_center.py --version "$version" --archive "dist/libtxms-$version.tar.gz"
python tools/check_conan_center.py --version "$version" --archive "dist/libtxms-$version.tar.gz" --recipe release-stage/recipes/libtxms/all
tar -czf "dist/libtxms-$version-conan-center.tar.gz" -C release-stage LICENSE recipes
- name: Checksum all release assets
run: |
cd dist
Expand Down Expand Up @@ -61,11 +53,3 @@ jobs:
run: cd dist && sha256sum --check SHA256SUMS
- name: Attach tested assets to the published release
run: gh release upload "$TAG" dist/*
conan-center:
needs: publish
if: vars.CONAN_CENTER_FORK != ''
uses: ./.github/workflows/conan-center.yml
with:
tag: ${{ github.event.release.tag_name }}
secrets:
CONAN_CENTER_TOKEN: ${{ secrets.CONAN_CENTER_TOKEN }}
45 changes: 4 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,49 +105,12 @@ tests run; assets are attached only after all tests and package checks pass.
through GitHub's Releases page. Pushing a tag alone does not run this workflow.
3. After checking the tag/version and passing tests, the workflow uploads:
- `libtxms-0.1.0.tar.gz`: source from the exact tested Git commit.
- `libtxms-0.1.0-conan-center.tar.gz`: staged ConanCenter recipe and consumer test.
- `release.json`: version, commit and source checksum.
- `SHA256SUMS`: checksums for all release assets.

The workflow tests static/shared ConanCenter packages from that same archive,
then uploads assets to the existing release using `GITHUB_TOKEN`. Prereleases
are skipped. Existing assets are not overwritten. No prebuilt platform libraries
are attached; Conan builds the appropriate package.

## ConanCenter submission automation

ConanCenter accepts recipes through reviewed pull requests; its own build
service publishes packages after merge. See the [official contribution guide](https://docs.conan.io/2/tutorial/conan_repositories/conan_center.html).
This repository prepares and submits the recipe; it cannot grant ConanCenter
approval or claim the package is already available there.

Configure the following **in the libtxms GitHub repository**:

| Setting | Value |
| --- | --- |
| Repository variable `CONAN_CENTER_FORK` | Your existing fork, e.g. `DataLayerHost/conan-center-index` |
| Actions secret `CONAN_CENTER_TOKEN` | Token able to push to that fork and open PRs in `conan-io/conan-center-index` |

A classic PAT with `public_repo` is one option for public repositories; use a
service account with the required access and follow your organization's token
policy. The default `GITHUB_TOKEN` cannot write to a separate fork. Never store
the token in source files. A first-time submitter may need to sign ConanCenter's
CLA. ConanCenter maintainers also decide acceptance of the custom CORE license;
the recipe declares `LicenseRef-libtxms-CORE` and includes its complete text.

When the fork variable is set, successful release asset upload directly calls
[conan-center.yml](.github/workflows/conan-center.yml). This avoids relying on a
second release event generated by `GITHUB_TOKEN`. The workflow downloads the
published source, checks its checksum and commit metadata, rebuilds static/shared
packages, and opens or updates a recipe PR. It preserves earlier versions and
refuses to replace an existing version's source metadata. Branches are pushed
normally, without force. If the variable is absent, the release still includes
the prepared recipe bundle and automatic PR submission is skipped.

For a failed submission after publication, run **Actions → Submit libtxms to
ConanCenter → Run workflow**, supplying the existing tag. A missing token fails
submission without changing the published release. This manual path verifies
release assets and reruns package tests too. Until ConanCenter accepts the PR,
use `conan create .` from the matching release checkout.
The workflow uploads assets to the existing release using `GITHUB_TOKEN` after
CI succeeds. Prereleases are skipped. Existing assets are not overwritten.
No prebuilt platform libraries are attached; consumers can build from source
or use the included local Conan recipe. ConanCenter publication is disabled.

Local validation details are in [tests/VALIDATION.md](tests/VALIDATION.md).
62 changes: 0 additions & 62 deletions packaging/conan-center/conanfile.py

This file was deleted.

8 changes: 2 additions & 6 deletions tests/VALIDATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ its effect on binary round trips. Malformed escape inputs are deliberately rejec
- Release tooling tests passed: tag/version matching, exact-commit archives,
dirty-tree rejection and dependency metadata.
- libtxms Conan 2.32.0 static/shared packages and their separate C consumer passed
on macOS arm64 and Debian 12 arm64. The staged ConanCenter download recipe also
passed both configurations on both operating systems using the same checksummed
archive served by a local HTTP server.
- ConanCenter metadata tests verify preserved older versions, idempotent updates,
refusal to replace a version checksum, and tampered-archive rejection.
on macOS arm64 and Debian 12 arm64.
- macOS codec and gateway sanitizer suites passed after the CMake packaging changes.
- No release or upstream ConanCenter PR was published. Hosted Windows packaging
- No release was published during these local checks. Hosted Windows packaging
and the actual GitHub publication steps remain to be exercised by CI after push.
45 changes: 1 addition & 44 deletions tests/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ def test_published_release_uploads_only_after_tests(self):
commands = "\n".join(step.get("run", "") for step in jobs["publish"]["steps"])
self.assertIn('gh release upload "$TAG"', commands)
self.assertNotIn("gh release create", commands)
if "conan-center" in jobs:
self.assertEqual(jobs["conan-center"]["needs"], "publish")
self.assertEqual(jobs["conan-center"]["with"]["tag"], "${{ github.event.release.tag_name }}")


@unittest.skipUnless((ROOT / "LIBTXMS_REVISION").exists(), "Gateway dependency check")
def test_gateway_checks_out_pinned_commit_in_every_build(self):
Expand All @@ -103,46 +101,5 @@ def test_gateway_checks_out_pinned_commit_in_every_build(self):
self.assertEqual(checkout["with"]["ref"], "${{ env.LIBTXMS_REF }}")
self.assertTrue(any("cat LIBTXMS_REVISION" in step.get("run", "") for step in steps))


if (ROOT / "tools/prepare_conan_center.py").exists():
from prepare_conan_center import prepare
from submit_conan_center import merge_recipe
from verify_release import verify

class ConanCenterTests(unittest.TestCase):
setUp = ReleaseTests.setUp
tearDown = ReleaseTests.tearDown
git = ReleaseTests.git
def test_release_verification_rejects_tampering(self):
out = self.root / "dist"
metadata = build_release(self.root, "libtxms", "0.1.0", out)
with (out / "SHA256SUMS").open("a") as checksums:
checksums.write(hashlib.sha256((out / "release.json").read_bytes()).hexdigest() + " release.json\n")
self.assertEqual(verify(out, "0.1.0", metadata["commit"]), metadata)
(out / "libtxms-0.1.0.tar.gz").write_bytes(b"tampered")
with self.assertRaises(ValueError):
verify(out, "0.1.0", metadata["commit"])

def test_conan_metadata_preserves_existing_versions(self):
out = self.root / "dist"
build_release(self.root, "libtxms", "0.1.0", out)
stage = self.root / "stage"
prepare(ROOT, "0.1.0", out / "libtxms-0.1.0.tar.gz", stage)
destination = self.root / "index"
old = destination / "recipes/libtxms/all"
old.mkdir(parents=True)
(old / "conandata.yml").write_text(yaml.safe_dump({"sources": {"0.0.9": {"url": "https://example.invalid/old", "sha256": "a"*64}}}))
(old.parent / "config.yml").write_text(yaml.safe_dump({"versions": {"0.0.9": {"folder": "all"}}}))
merge_recipe(stage, destination, "0.1.0")
before = (old / "conandata.yml").read_bytes()
self.assertEqual(set(yaml.safe_load(before)["sources"]), {"0.0.9", "0.1.0"})
merge_recipe(stage, destination, "0.1.0")
self.assertEqual(before, (old / "conandata.yml").read_bytes())
data = yaml.safe_load((stage / "recipes/libtxms/all/conandata.yml").read_text())
data["sources"]["0.1.0"]["sha256"] = "b"*64
(stage / "recipes/libtxms/all/conandata.yml").write_text(yaml.safe_dump(data))
with self.assertRaises(ValueError):
merge_recipe(stage, destination, "0.1.0")

if __name__ == "__main__":
unittest.main()
34 changes: 0 additions & 34 deletions tools/check_conan_center.py

This file was deleted.

39 changes: 0 additions & 39 deletions tools/prepare_conan_center.py

This file was deleted.

Loading
Loading