Skip to content

Commit

Permalink
Add publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
CobySim01 committed Sep 26, 2023
1 parent f77c534 commit f0f1893
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish Python package

on:
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Build and publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry build
poetry publish
2 changes: 1 addition & 1 deletion sqlxfluff/formatters/indent.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def replace_with_indentation(source, target, replacement):
# Determine the start of the line where the target string was found
line_start = source.rfind("\n", 0, match.start()) + 1

# Compute the indentation as the spaces from the start of the line until the first non-space character
# Compute number of spaces at start of the line
indentation_level = 0
for char in source[line_start : match.start()]:
if char != " ":
Expand Down
5 changes: 0 additions & 5 deletions sqlxfluff/formatters/sqlx.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
from sys import exit # pylint: disable=redefined-builtin

import sqlfluff
from termcolor import cprint

from ..constants import EXIT_FAIL
from ..parsing import parse_sqlx
from .base import format_config, format_template
from .indent import replace_with_indentation

Expand Down

0 comments on commit f0f1893

Please sign in to comment.