Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(release-please): release-please as a new option for release automation (WIP) #304

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions src/scicookie/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
],
"governance_document": ["None", "numpy-governance", "sciml-governance"],
"roadmap_document": ["None", "pytorch-ignite-roadmap"],
"release_workflow": ["semantic-release", "release-please", "None"],
"build_system": [
"poetry",
"flit",
Expand Down
12 changes: 12 additions & 0 deletions src/scicookie/profiles/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,18 @@ roadmap_document:
- pytorch-ignite-roadmap
visible: true

release_workflow:
message: Select one option for release automation tool for this project
help: "For more information, check:\n https://osl-incubator.github.io/scicookie/guide/#release-workflow"
type: single-choice
default: semantic-release
Naman-Priyadarshi marked this conversation as resolved.
Show resolved Hide resolved
# first choice is the default for the UI
choices:
- semantic-release
- release-please
- None
visible: true

git_username:
message: Type the GIT username
help: https://osl-incubator.github.io/scicookie/guide/#control-version
Expand Down
4 changes: 4 additions & 0 deletions src/scicookie/profiles/osl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ roadmap_document:
default: None
visible: false

release_workflow:
default: semantic-release
visible: false

git_username:
default: yorbriar
visible: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,24 @@
{% set package_path = cookiecutter.package_slug -%}
{% endif -%}
{% set cpp_path = "src" -%}
{% if cookiecutter.release_workflow == "semantic-release -%}
project(
'{{ cookiecutter.project_slug }}',
'cpp',
version: '{{ cookiecutter.project_version }}', # semantic-release
license: '{{ cookiecutter.project_license }}',
meson_version: '>= 1.1.0',
)
{% endif -%}
{% if cookiecutter.release_workflow == "release-please -%}
project(
'{{ cookiecutter.project_slug }}',
'cpp',
version: '{{ cookiecutter.project_version }}', # release-please
license: '{{ cookiecutter.project_license }}',
meson_version: '>= 1.1.0',
)
{% endif -%}
name = '{{ cookiecutter.package_slug }}'

cpp_sources = files('src/main.cpp')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@

[tool.poetry]
name = "{{ cookiecutter.project_slug }}"
{% if cookiecutter.release_workflow == "semantic-release" -%}
version = "{{ cookiecutter.project_version }}" #semantic-release
{% endif -%}
{% if cookiecutter.release_workflow == "release-please" -%}
version = "{{ cookiecutter.project_version }}" #release-please
{% endif -%}
description = "{{ cookiecutter.project_short_description }}"
readme = "README.md"
authors = ["{{ cookiecutter.author_full_name }} <{{ cookiecutter.author_email }}>"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies:
- pybind11
- cmake
{%- endif %}
- nodejs # used by semantic-release
- nodejs # used by semantic-release and release-please
{%- if cookiecutter.use_shellcheck == "yes" %}
- shellcheck
{%- endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cmake
pybind11
cmake
{%- endif %}
nodejs # used by semantic-release
nodejs # used by semantic-release and release-please
{%- if cookiecutter.use_shellcheck == "yes" %}
shellcheck
{%- endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ def get_version() -> str:
try:
return importlib_metadata.version(__name__)
except importlib_metadata.PackageNotFoundError: # pragma: no cover
{%- if cookiecutter.release_worlflow == "semantic-release" %}
return {{ QUOTE }}{{ cookiecutter.project_version }}{{ QUOTE }} # semantic-release
{%- endif %}
{%- if cookiecutter.release_worlflow == "release-please" %}
return {{ QUOTE }}{{ cookiecutter.project_version }}{{ QUOTE }} # release-please
{%- endif %}


version = get_version()
Expand Down
Loading