From 41a5521a8dcab9cdfbbe5352b36bd179a6d0307c Mon Sep 17 00:00:00 2001 From: ric-evans Date: Mon, 29 Jul 2024 10:47:12 -0400 Subject: [PATCH] Auto-create `pyproject.toml` --- action.yml | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/action.yml b/action.yml index fde75d9..d634165 100644 --- a/action.yml +++ b/action.yml @@ -81,29 +81,34 @@ runs: fi shell: bash - - name: check for deprecated features + - name: Git config if: env.IS_GIT_BEHIND != 'true' run: | - if [[ -f setup.cfg ]]; then - echo " " - echo "WIPACrepo/wipac-dev-py-setup-action no longer supports 'setup.cfg'" - echo "Migration Steps:" - echo " 1. Manually move attributes from [wipac:cicd_setup_builder]" - echo " section to WIPACrepo/wipac-dev-py-setup-action's 'with' block." - echo " See https://github.com/WIPACrepo/wipac-dev-py-setup-action#inputs" - echo " 2. Migrate any non-autogenerated configuration to 'pyproject.toml', " - echo " then delete 'setup.cfg'. If there is no non-autogenerated" - echo " configuration, simply delete 'setup.cfg'." - echo " 3. Re-run this action!" - exit 1 - fi + git config user.name ${{ inputs.git_committer_name }} + git config user.email ${{ inputs.git_committer_email }} shell: bash - - name: Git config + - name: check for deprecated features if: env.IS_GIT_BEHIND != 'true' run: | - git config user.name ${{ inputs.git_committer_name }} - git config user.email ${{ inputs.git_committer_email }} + if [[ -f setup.cfg ]]; then + if [[ ! -f pyproject.toml ]]; then + # auto-create a blank toml that will be added to in next steps + # when this action runs on next commit, it will match the 'else' condition below + touch pyproject.toml + else + echo " " + echo "WIPACrepo/wipac-dev-py-setup-action no longer supports 'setup.cfg'" + echo "Migration Steps:" + echo " 1. Manually move attributes from [wipac:cicd_setup_builder]" + echo " section to WIPACrepo/wipac-dev-py-setup-action's 'with' block." + echo " See https://github.com/WIPACrepo/wipac-dev-py-setup-action#inputs" + echo " 2. Migrate any non-autogenerated configuration to 'pyproject.toml', " + echo " then delete 'setup.cfg'. If there is no non-autogenerated" + echo " configuration, simply delete 'setup.cfg'." + echo " 3. Re-run this action!" + fi + fi shell: bash - name: Build pyproject.toml + README.md (and commit)