generated from childmindresearch/template-python-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix pre-commit errors * Remove poetry-lock hook from pre-commit config
- Loading branch information
1 parent
3e40a55
commit 19cd54a
Showing
5 changed files
with
85 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,48 @@ | ||
name: "Publish to PyPi" | ||
name: Publish to PyPi | ||
|
||
permissions: | ||
actions: "write" | ||
actions: write | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Python Tests"] | ||
workflows: [Python Tests] | ||
types: | ||
- completed | ||
- completed | ||
branches: | ||
- main | ||
- main | ||
|
||
jobs: | ||
pypi-release: | ||
name: "PyPi Release" | ||
runs-on: "ubuntu-latest" | ||
name: PyPi Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }} | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: pyproject.toml | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }} | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: pyproject.toml | ||
|
||
- name: Skip if version did not change. | ||
run: | | ||
version_change=$(git diff -r HEAD^1 pyproject.toml | grep -E "^(\+|-)version =") | ||
if [[ -z "$version_change" ]]; then | ||
gh run cancel ${{ github.run_id }} | ||
gh run watch ${{ github.run_id }} | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Skip if version did not change. | ||
run: | | ||
version_change=$(git diff -r HEAD^1 pyproject.toml | grep -E "^(\+|-)version =") | ||
if [[ -z "$version_change" ]]; then | ||
gh run cancel ${{ github.run_id }} | ||
gh run watch ${{ github.run_id }} | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build package. | ||
run: | | ||
pipx install poetry | ||
poetry install --only main | ||
poetry build | ||
- name: Build package. | ||
run: | | ||
pipx install poetry | ||
poetry install --only main | ||
poetry build | ||
- name: Publish to PyPi. | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
verbose: true | ||
- name: Publish to PyPi. | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters