Update publish actions and Dockerfile. (#5390)

This commit is contained in:
Alan Cruickshank
2023-11-08 22:35:40 +00:00
committed by GitHub
parent 4d8f7471de
commit 58741def84
5 changed files with 22 additions and 29 deletions

View File

@@ -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 }}

View File

@@ -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

View File

@@ -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 }}

View File

@@ -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.

View File

@@ -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"