forked from repo-mirrors/sqlfluff
Update publish actions and Dockerfile. (#5390)
This commit is contained in:
@@ -28,7 +28,7 @@ jobs:
|
||||
run: cp -r plugins/sqlfluff-templater-dbt/dist/. dist/
|
||||
|
||||
- name: Publish Python distribution to PyPI
|
||||
uses: pypa/gh-action-pypi-publish@master
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_DBT_TEMPLATER_TOKEN }}
|
||||
|
||||
@@ -25,15 +25,15 @@ jobs:
|
||||
# Setup QEMU and Buildx to allow for multi-platform builds.
|
||||
- name: Set up QEMU
|
||||
id: docker_qemu
|
||||
uses: docker/setup-qemu-action@v1
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
id: docker_buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
# Authenticate with DockerHub.
|
||||
- name: Login to DockerHub
|
||||
id: docker_login
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
# Build amd64 image to use in the integration test.
|
||||
- name: Build and export to Docker
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
load: true
|
||||
tags: ${{ env.TEST_TAG }}
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
# N.B. We tag this image as both latest and with its version number.
|
||||
- name: Build and push
|
||||
id: docker_build_push
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
run: tox -e build-dist
|
||||
|
||||
- name: Publish Python distribution to PyPI
|
||||
uses: pypa/gh-action-pypi-publish@master
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_TOKEN }}
|
||||
|
||||
11
Dockerfile
11
Dockerfile
@@ -7,19 +7,20 @@ WORKDIR /app
|
||||
ENV VIRTUAL_ENV /app/.venv
|
||||
RUN python -m venv $VIRTUAL_ENV
|
||||
ENV PATH $VIRTUAL_ENV/bin:$PATH
|
||||
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
|
||||
RUN pip install --no-cache-dir --upgrade pip setuptools wheel pip-tools
|
||||
|
||||
# Install requirements separately
|
||||
# to take advantage of layer caching.
|
||||
# N.B. we extract the requirements from setup.cfg
|
||||
COPY setup.cfg .
|
||||
RUN python -c "import configparser; c = configparser.ConfigParser(); c.read('setup.cfg'); print(c['options']['install_requires'])" > requirements.txt
|
||||
# N.B. we extract the requirements from pyproject.toml
|
||||
COPY pyproject.toml .
|
||||
# Use piptools to extract requirements from pyproject.toml as described in
|
||||
# https://github.com/pypa/pip/issues/11584
|
||||
RUN pip-compile -o requirements.txt pyproject.toml -v --strip-extras
|
||||
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
||||
|
||||
# Copy minimal set of SQLFluff package files.
|
||||
COPY MANIFEST.in .
|
||||
COPY README.md .
|
||||
COPY setup.py .
|
||||
COPY src ./src
|
||||
|
||||
# Install sqlfluff package.
|
||||
|
||||
@@ -103,23 +103,6 @@ Changes = "https://github.com/sqlfluff/sqlfluff/blob/main/CHANGELOG.md"
|
||||
Twitter = "https://twitter.com/SQLFluff"
|
||||
Chat = "https://github.com/sqlfluff/sqlfluff#sqlfluff-on-slack"
|
||||
|
||||
|
||||
[tool.sqlfluff_docs]
|
||||
# NOTE: Stable version is used by docs/conf.py
|
||||
stable_version = "2.3.5"
|
||||
|
||||
|
||||
[tool.setuptools]
|
||||
package-dir = {"" = "src"}
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["src"]
|
||||
namespaces = false
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
sqlfluff = ["config.ini", "core/default_config.cfg", "py.typed"]
|
||||
|
||||
|
||||
[project.scripts]
|
||||
sqlfluff = "sqlfluff.cli.commands:cli"
|
||||
|
||||
@@ -143,6 +126,15 @@ sqlfluff_rules_jinja = "sqlfluff.rules.jinja"
|
||||
sqlfluff_rules_tsql = "sqlfluff.rules.tsql"
|
||||
|
||||
|
||||
[tool.sqlfluff_docs]
|
||||
# NOTE: Stable version is used by docs/conf.py
|
||||
stable_version = "2.3.5"
|
||||
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
sqlfluff = ["core/default_config.cfg", "py.typed"]
|
||||
|
||||
|
||||
[tool.importlinter]
|
||||
root_package = "sqlfluff"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user