Skip to content

Commit

Permalink
feat(github-actions): add an action build directive to toggle the `…
Browse files Browse the repository at this point in the history
…--skip-build` option (#1044)

* docs(commands): update definition of the version commands `--skip-build` option

* docs(github-actions): add description of the `build` input directive
  • Loading branch information
codejedi365 authored Oct 7, 2024
1 parent 6a37159 commit 26597e2
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
1 change: 1 addition & 0 deletions action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ ARGS+=("$(eval_boolean_action_input "tag" "$INPUT_TAG" "--tag" "--no-tag")") ||
ARGS+=("$(eval_boolean_action_input "push" "$INPUT_PUSH" "--push" "--no-push")") || exit 1
ARGS+=("$(eval_boolean_action_input "changelog" "$INPUT_CHANGELOG" "--changelog" "--no-changelog")") || exit 1
ARGS+=("$(eval_boolean_action_input "vcs_release" "$INPUT_VCS_RELEASE" "--vcs-release" "--no-vcs-release")") || exit 1
ARGS+=("$(eval_boolean_action_input "build" "$INPUT_BUILD" "" "--skip-build")") || exit 1

# Handle --patch, --minor, --major
# https://stackoverflow.com/a/47541882
Expand Down
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ inputs:
description: |
Whether or not to create a release in the remote VCS, if supported
build:
type: string
required: false
description: |
Whether or not to run the build_command for the project. Defaults are
handled by python-semantic-release internal version command.
build_metadata:
type: string
required: false
Expand Down
25 changes: 25 additions & 0 deletions docs/automatic-releases/github-actions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,31 @@ outlines each supported input and its purpose.

----

.. _gh_actions-psr-inputs-build:

``build``
""""""""

**Type:** ``Literal["true", "false"]``

Override whether the action should execute the build command or not. This option is
equivalent to adding the command line switch ``--skip-build`` (when ``false``) to
the :ref:`version <cmd-version>` command. If set to ``true``, no command line switch
is passed and the default behavior of the :ref:`version <cmd-version>` is used.

**Required:** ``false``

.. note::
If not set or set to ``true``, the default behavior is defined by the
:ref:`version <cmd-version>` command and any user :ref:`configurations <config-root>`.

.. seealso::

- :ref:`cmd-version-option-skip_build` option for the :ref:`version <cmd-version>`
command.

----

.. _gh_actions-psr-inputs-build_metadata:

``build_metadata``
Expand Down
5 changes: 4 additions & 1 deletion docs/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,13 @@ remote VCS, this option will not cause a command failure, but will produce a war
**Default:** ``--no-vcs-release`` if ``--no-push`` is supplied (including where this is
implied by supplying only ``--no-commit``), otherwise ``--vcs-release``

.. _cmd-version-option-skip_build:

``--skip-build``
****************

If passed, skip building the current project using :ref:`build_command <config-build_command>`.
If passed, skip execution of the :ref:`build_command <config-build_command>` after
version stamping and changelog generation.

.. _cmd-publish:

Expand Down

0 comments on commit 26597e2

Please sign in to comment.