Skip to content

Commit

Permalink
adjust order of git status check
Browse files Browse the repository at this point in the history
  • Loading branch information
btschwertfeger committed Jan 26, 2024
1 parent be451ae commit 83acc36
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
python -m pip install --upgrade pip
python -m pip install build
- name: Build the package
run: python -m build --outdir .

- name: Check git status (not Windows)
if: runner.os != 'Windows'
run: |
Expand All @@ -56,10 +59,6 @@ jobs:
git status --porcelain
exit 1
}
- name: Build the package
run: python -m build --outdir .

- name: Install the package on Linux or MacOS
if: runner.os != 'Windows'
run: python -m pip install python_kraken_sdk*.whl
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/_pypi_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ jobs:
with:
fetch-depth: 0 # IMPORTANT: otherwise the current tag does not get fetched and the build version gets worse

- name: Check git status
run: |
if [[ -z "$(git status --porcelain)" ]]; then
echo "No changes found."
else
echo "Changes detected. Please commit or discard changes before publishing."
git status --porcelain
exit 1
fi
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
Expand All @@ -55,6 +45,16 @@ jobs:
- name: Build the package
run: python -m build .

- name: Check git status
run: |
if [[ -z "$(git status --porcelain)" ]]; then
echo "No changes found."
else
echo "Changes detected. Please commit or discard changes before publishing."
git status --porcelain
exit 1
fi
- name: Publish package distributions to PyPI (optional - testpypi)
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down

0 comments on commit 83acc36

Please sign in to comment.