Skip to content

Commit

Permalink
ci: install shfmt-py for formatting release
Browse files Browse the repository at this point in the history
  • Loading branch information
bonjourmauko committed Oct 23, 2024
1 parent 15193af commit a15cb1e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,6 @@ jobs:
- name: Force correct branch on workflow sha
run: git checkout -B ${{ github.ref_name }} ${{ github.sha }}

- name: Install Poetry
run: pipx install poetry

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: 3.12.6
cache: poetry

- name: Install Dependencies
run: poetry install --no-root --with dev --sync

- name: Semantic Version Tagging
uses: python-semantic-release/[email protected]
with:
Expand Down
6 changes: 5 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ build::apply_template() {
echo -e "$(colour::pass 'Make the output file executable')"
chmod u+x "${3}"
echo -e "$(colour::pass 'Formatting the output file')"
poetry run shfmt --write --simplify "${3}"
if command -v poetry &>/dev/null; then
poetry run shfmt --write --simplify "${3}"
else
shfmt --write --simplify "${3}"
fi
}

# Main function.
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ shfmt-py = "^3.7.0.1"
yamllint = "^1.35.1"

[tool.semantic_release]
build_command = "TERM=xterm-256color ./build.sh"
build_command = "pip install shfmt-py && TERM=xterm-256color ./build.sh"
tag_format = "{version}"
version_toml = [ "pyproject.toml:tool.poetry.version" ]
version_variables = [ "src/first_time_setup/messages.sh:version" ]
version_variables = [
"dist/first-time-setup.sh:version",
"src/first_time_setup/messages.sh:version",
]

0 comments on commit a15cb1e

Please sign in to comment.