xcookie.builders.github_actions module¶
- class xcookie.builders.github_actions.Actions[source]¶
Bases:
object
Help build Github Action JSON objects
Example
from xcookie.builders.github_actions import Actions import types for attr_name in dir(Actions):
- if not attr_name.startswith(‘_’):
attr = getattr(Actions, attr_name) if isinstance(attr, types.MethodType):
print(attr_name) action = attr()
…
- action_versions = {'checkout': 'actions/checkout@v3', 'setup-python': 'actions/setup-python@v4'}¶
- xcookie.builders.github_actions.build_github_actions(self)[source]¶
cat ~/code/xcookie/xcookie/rc/tests.yml.in | yq .jobs.lint cat ~/code/xcookie/xcookie/rc/tests.yml.in | yq .jobs.build_and_test_sdist cat ~/code/xcookie/xcookie/rc/tests.yml.in | yq .jobs.deploy cat ~/code/xcookie/xcookie/rc/tests.yml.in | yq .
Example
>>> from xcookie.builders.github_actions import * # NOQA >>> from xcookie.main import XCookieConfig >>> from xcookie.main import TemplateApplier >>> config = XCookieConfig(tags=['purepy']) >>> self = TemplateApplier(config) >>> text = build_github_actions(self) >>> print(text)
- xcookie.builders.github_actions.build_binpy_wheels_job(self)[source]¶
cat ~/code/xcookie/xcookie/rc/test_binaries.yml.in | yq .jobs.build_and_test_wheels
Notes
- Supported Action platforms:
https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
- xcookie.builders.github_actions.build_deploy(self, mode='live', needs=None)[source]¶
Example
>>> from xcookie.builders.github_actions import * # NOQA >>> from xcookie.main import XCookieConfig >>> from xcookie.main import TemplateApplier >>> config = XCookieConfig(tags=['purepy'], remote_group='Org', repo_name='Repo') >>> self = TemplateApplier(config) >>> self._presetup() >>> text = Yaml.dumps(build_deploy(self)) >>> print(text)
- xcookie.builders.github_actions.build_github_release(self, needs=None)[source]¶
References
https://github.com/marketplace/actions/create-a-release-in-a-github-action https://github.com/softprops/action-gh-release https://github.com/softprops/action-gh-release/issues/20#issuecomment-572245945