From 5dcdb3244ec843ce93eed31b1ba3fde05453171e Mon Sep 17 00:00:00 2001 From: Asaf Gardin Date: Mon, 18 Dec 2023 19:06:07 +0200 Subject: [PATCH 1/6] ci: precommit --- .pre-commit-config.yaml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 056cf5e8..42b3a452 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,6 +20,7 @@ repos: - id: trailing-whitespace - id: end-of-file-fixer - id: mixed-line-ending + exclude: (CHANGELOG.md) - id: check-json - id: check-toml - id: check-xml @@ -32,20 +33,7 @@ repos: hooks: - id: forbid-binary - id: git-check - # - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt - # rev: 0.1.0 - # hooks: - # - id: yamlfmt - # args: - # - --mapping - # - '2' - # - --sequence - # - '4' - # - --offset - # - '2' - # - --width - # - '300' - # - --implicit_start + files: "CHANGELOG.md" - repo: https://github.com/adrienverge/yamllint rev: v1.26.3 hooks: @@ -139,6 +127,19 @@ repos: entry: bash -eo pipefail -c 'shellcheck $@ -f diff | patch -p 1' -- - id: shellcheck name: Check sh files (and print violations) + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.0.0 + hooks: + - id: prettier + name: Formatter + exclude: (CHANGELOG.md) + additional_dependencies: + - prettier@2.8.8 + - "prettier-plugin-sh@0.12.8" + types_or: + - yaml + - markdown + - shell - repo: local hooks: - id: list-files @@ -155,7 +156,7 @@ repos: - -w - -s - -i - - '2' + - "2" types: - shell - id: markdownlint From c4134cbf0939333ad8318d9412ed1aefe3a52199 Mon Sep 17 00:00:00 2001 From: Asaf Gardin Date: Mon, 18 Dec 2023 19:06:27 +0200 Subject: [PATCH 2/6] fix: version name --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7f341164..321349bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ exclude_lines = [ ] [tool.poetry] -name = "ai21-python" +name = "ai21" version = "2.0.0-rc.2" description = "" authors = ["AI21 Labs"] diff --git a/setup.py b/setup.py index c9193239..8db436ba 100755 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ long_description = "\\n" + fh.read() setup( - name="ai21_python", + name="ai21", version=VERSION, license="MIT", author="AI21 Labs", From 9c3ce57a5f66bb063b0448bbdb5f7ff1459de5f6 Mon Sep 17 00:00:00 2001 From: Asaf Gardin Date: Tue, 19 Dec 2023 11:08:03 +0200 Subject: [PATCH 3/6] ci: Added rc pipeline for semantic release --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 321349bc..4842ebf0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -106,8 +106,8 @@ commit_message = "chore(release): v{version} [skip ci]" [tool.semantic_release.branches.main] match = "(main)" + +[tool.semantic_release.branches."Release Candidates"] +match = "(rc_*)" prerelease_token = "rc" prerelease = true - -[tool.semantic_release.changelog.environment] -newline_sequence = "\n" From 9febb1f7480e510b3ffcc8d652a2cfe76dfc72a6 Mon Sep 17 00:00:00 2001 From: Asaf Gardin Date: Tue, 19 Dec 2023 11:09:27 +0200 Subject: [PATCH 4/6] ci: pypi api keys --- .github/workflows/publish.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 3250a378..e27ee41b 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -37,5 +37,4 @@ jobs: uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: user: __token__ - password: ${{ secrets.TEST_PYPI_TOKEN }} - repository_url: https://test.pypi.org/legacy/ + password: ${{ secrets.PYPI_API_TOKEN }} From ccc334f0c3ffec6496c39859966d9663d027780d Mon Sep 17 00:00:00 2001 From: Asaf Gardin Date: Tue, 19 Dec 2023 11:08:03 +0200 Subject: [PATCH 5/6] ci: Added rc pipeline for semantic release --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index de30502a..9ec202da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -106,8 +106,8 @@ commit_message = "chore(release): v{version} [skip ci]" [tool.semantic_release.branches.main] match = "(main)" + +[tool.semantic_release.branches."Release Candidates"] +match = "(rc_*)" prerelease_token = "rc" prerelease = true - -[tool.semantic_release.changelog.environment] -newline_sequence = "\n" From 4324df2a3f19d588f63856db41dea14fce6b462c Mon Sep 17 00:00:00 2001 From: Asaf Gardin Date: Tue, 19 Dec 2023 11:09:27 +0200 Subject: [PATCH 6/6] ci: pypi api keys --- .github/workflows/publish.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 3250a378..e27ee41b 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -37,5 +37,4 @@ jobs: uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: user: __token__ - password: ${{ secrets.TEST_PYPI_TOKEN }} - repository_url: https://test.pypi.org/legacy/ + password: ${{ secrets.PYPI_API_TOKEN }}