From 0e4d6ae1f3a640bf175c134ede3090301d2f5452 Mon Sep 17 00:00:00 2001 From: ilai Date: Tue, 31 Oct 2023 18:48:18 +0200 Subject: [PATCH 01/39] [CI] Changed pre-release to build.yml Will be used to build wheels, then we'll publish them --- .../{pre-release-CI.yml => build.yml} | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) rename .github/workflows/{pre-release-CI.yml => build.yml} (75%) diff --git a/.github/workflows/pre-release-CI.yml b/.github/workflows/build.yml similarity index 75% rename from .github/workflows/pre-release-CI.yml rename to .github/workflows/build.yml index a943abac..7138c113 100644 --- a/.github/workflows/pre-release-CI.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Pre Release CI +name: Build and Test installation on: workflow_dispatch: @@ -31,6 +31,9 @@ jobs: uses: snok/install-poetry@v1 with: version: 1.3.2 + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true - name: Build wheel run: | @@ -40,15 +43,17 @@ jobs: run: | pip install dist/pinecone_canopy*.whl - - name: Create dev requirements file - run: | - poetry export -f requirements.txt --without-hashes --only dev -o only-dev.txt + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: ./dist/ - - name: Install dev requirements + - name: Install dev dependencies run: | - pip install -r only-dev.txt + poetry install --no-root --only dev --no-interaction - - name: Run tests + - name: Run unit tests run: pytest --html=report.html --self-contained-html tests/unit - name: Upload pytest reports From cd4f22d81f56e64449b2233a06417e95b987baa6 Mon Sep 17 00:00:00 2001 From: ilai Date: Tue, 31 Oct 2023 18:52:20 +0200 Subject: [PATCH 02/39] TEMP! rename back --- .github/workflows/{build.yml => pre-release-CI.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build.yml => pre-release-CI.yml} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/pre-release-CI.yml similarity index 100% rename from .github/workflows/build.yml rename to .github/workflows/pre-release-CI.yml From 67e13bff48a374939aa399f324b6a0c15ce8c5fe Mon Sep 17 00:00:00 2001 From: ilai Date: Tue, 31 Oct 2023 19:00:03 +0200 Subject: [PATCH 03/39] [CI] build - upload all wheels --- .github/actions/install-deps-and-canopy/action.yml | 2 +- .github/workflows/pre-release-CI.yml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/actions/install-deps-and-canopy/action.yml b/.github/actions/install-deps-and-canopy/action.yml index 4b8968c0..35f7d460 100644 --- a/.github/actions/install-deps-and-canopy/action.yml +++ b/.github/actions/install-deps-and-canopy/action.yml @@ -17,7 +17,7 @@ runs: uses: snok/install-poetry@v1 with: version: 1.3.2 - virtualenvs-create: true + virtualenvs-create: no virtualenvs-in-project: true installer-parallel: true #---------------------------------------------- diff --git a/.github/workflows/pre-release-CI.yml b/.github/workflows/pre-release-CI.yml index 7138c113..c2bbc4f9 100644 --- a/.github/workflows/pre-release-CI.yml +++ b/.github/workflows/pre-release-CI.yml @@ -31,8 +31,7 @@ jobs: uses: snok/install-poetry@v1 with: version: 1.3.2 - virtualenvs-create: true - virtualenvs-in-project: true + virtualenvs-create: false installer-parallel: true - name: Build wheel @@ -46,7 +45,7 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v3 with: - name: wheels + name: wheels-${{ matrix.os }}-py${{ matrix.python-version }} path: ./dist/ - name: Install dev dependencies From 531b2e5be2c613423fca8155e1fcfb16a29af2d4 Mon Sep 17 00:00:00 2001 From: ilai Date: Tue, 31 Oct 2023 19:43:09 +0200 Subject: [PATCH 04/39] [CI] Single build, multiple test No need to build separately on each OS, since it's pure python code --- .github/workflows/pre-release-CI.yml | 56 ++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pre-release-CI.yml b/.github/workflows/pre-release-CI.yml index c2bbc4f9..6f630ee2 100644 --- a/.github/workflows/pre-release-CI.yml +++ b/.github/workflows/pre-release-CI.yml @@ -8,8 +8,40 @@ concurrency: cancel-in-progress: true jobs: + build: + name: Build python${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.9, '3.10', 3.11] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: 1.3.2 + + - name: Build wheel + run: | + poetry build + + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels-py${{ matrix.python-version }} + path: ./dist/ + + build-and-test: - name: Build & Test on ${{ matrix.os }}-py${{ matrix.python-version }} + name: Test on ${{ matrix.os }}-py${{ matrix.python-version }} + needs: build runs-on: ${{ matrix.os }} strategy: matrix: @@ -31,27 +63,29 @@ jobs: uses: snok/install-poetry@v1 with: version: 1.3.2 - virtualenvs-create: false + virtualenvs-create: true + virtualenvs-in-project: true installer-parallel: true - - name: Build wheel - run: | - poetry build + - name: Download wheels + uses: actions/download-artifact@v2 + with: + name: wheels-py${{ matrix.python-version }} + path: ./dist/ - name: Install the wheel run: | + source $VENV pip install dist/pinecone_canopy*.whl - - name: Upload wheels - uses: actions/upload-artifact@v3 - with: - name: wheels-${{ matrix.os }}-py${{ matrix.python-version }} - path: ./dist/ - - name: Install dev dependencies run: | poetry install --no-root --only dev --no-interaction + - name: Debug print canopy + run: | + python -c "import canopy; print(canopy.__file__)" + - name: Run unit tests run: pytest --html=report.html --self-contained-html tests/unit From 043cb0ddf8ca13a3398bfe6a3bb67d989e83955d Mon Sep 17 00:00:00 2001 From: ilai Date: Tue, 31 Oct 2023 19:54:29 +0200 Subject: [PATCH 05/39] [CI] Install dependencies before wheel So the VENV will exist --- .github/workflows/pre-release-CI.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pre-release-CI.yml b/.github/workflows/pre-release-CI.yml index 6f630ee2..3fd57f79 100644 --- a/.github/workflows/pre-release-CI.yml +++ b/.github/workflows/pre-release-CI.yml @@ -73,15 +73,15 @@ jobs: name: wheels-py${{ matrix.python-version }} path: ./dist/ + - name: Install dev dependencies + run: | + poetry install --no-root --only dev --no-interaction + - name: Install the wheel run: | source $VENV pip install dist/pinecone_canopy*.whl - - name: Install dev dependencies - run: | - poetry install --no-root --only dev --no-interaction - - name: Debug print canopy run: | python -c "import canopy; print(canopy.__file__)" From 168664e190f3bcead3974515cd29b42ef1027256 Mon Sep 17 00:00:00 2001 From: ilai Date: Tue, 31 Oct 2023 20:25:59 +0200 Subject: [PATCH 06/39] [CI] Activate in every run Let's see if that helps --- .github/workflows/pre-release-CI.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pre-release-CI.yml b/.github/workflows/pre-release-CI.yml index 3fd57f79..a03ad57d 100644 --- a/.github/workflows/pre-release-CI.yml +++ b/.github/workflows/pre-release-CI.yml @@ -84,10 +84,13 @@ jobs: - name: Debug print canopy run: | + source $VENV python -c "import canopy; print(canopy.__file__)" - name: Run unit tests - run: pytest --html=report.html --self-contained-html tests/unit + run: | + source $VENV + pytest --html=report.html --self-contained-html tests/unit - name: Upload pytest reports if: always() From 0c0335ef6b0655da47a3acea3405016eb2a55020 Mon Sep 17 00:00:00 2001 From: ilai Date: Wed, 1 Nov 2023 11:42:46 +0200 Subject: [PATCH 07/39] [CI] Trying to download artifacts from build flow Let's see if that even works --- .github/workflows/release.yml | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..6796d930 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +name: 'PyPI Release: Production (pinecone-client)' + +on: + workflow_dispatch: + inputs: + releaseLevel: + description: 'Release level' + required: true + type: choice + default: 'patch' + options: + - 'patch' # bug fixes + - 'minor' # new features, backwards compatible + - 'major' # breaking changes + generateBranch: + description: 'Whether to generate a release branch' + required: true + type: boolean + default: false + generateTag: + description: 'Whether to generate a release tag' + required: true + type: boolean + default: true + +env: + PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} + PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} + + +jobs: + build: + uses: ./github/workflows/pre-release-CI.yml + + publish: + requires: build + runs-on: ubuntu-latest + steps: + - name: download wheels + uses: actions/download-artifact@v2 + with: + path: wheels + + - name: debug print wheels + run: | + ls -lah wheels/ \ No newline at end of file From fb7d55961eed06bcfc88a39c823849bff8ecbe92 Mon Sep 17 00:00:00 2001 From: ilai Date: Wed, 1 Nov 2023 11:43:42 +0200 Subject: [PATCH 08/39] [CI] TEMP! made release workflow run on push For testing purposes --- .github/workflows/pre-release-CI.yml | 6 +----- .github/workflows/release.yml | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pre-release-CI.yml b/.github/workflows/pre-release-CI.yml index a03ad57d..fd9e14c2 100644 --- a/.github/workflows/pre-release-CI.yml +++ b/.github/workflows/pre-release-CI.yml @@ -2,6 +2,7 @@ name: Build and Test installation on: workflow_dispatch: + workflow_call: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -82,11 +83,6 @@ jobs: source $VENV pip install dist/pinecone_canopy*.whl - - name: Debug print canopy - run: | - source $VENV - python -c "import canopy; print(canopy.__file__)" - - name: Run unit tests run: | source $VENV diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6796d930..5ef1f441 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,7 @@ on: required: true type: boolean default: true + push: env: PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} From 96f612dcb767b7abaf857bf66a910796468043a6 Mon Sep 17 00:00:00 2001 From: ilai Date: Wed, 1 Nov 2023 11:45:36 +0200 Subject: [PATCH 09/39] TEMP! trying to add version --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5ef1f441..8ad74319 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ env: jobs: build: - uses: ./github/workflows/pre-release-CI.yml + uses: ./github/workflows/pre-release-CI.yml@v1 publish: requires: build From c55c5d5ba6412c21a10ca20a645cd401119f8a3e Mon Sep 17 00:00:00 2001 From: ilai Date: Wed, 1 Nov 2023 11:48:33 +0200 Subject: [PATCH 10/39] missing ./ --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ad74319..d5ac124c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ env: jobs: build: - uses: ./github/workflows/pre-release-CI.yml@v1 + uses: ./.github/workflows/pre-release-CI.yml publish: requires: build From 43d17f491a6307a25cfa51d506e798e9aa4074d8 Mon Sep 17 00:00:00 2001 From: ilai Date: Wed, 1 Nov 2023 11:51:16 +0200 Subject: [PATCH 11/39] [CI] wrong key --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d5ac124c..62f34dc9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,7 @@ jobs: uses: ./.github/workflows/pre-release-CI.yml publish: - requires: build + needs: build runs-on: ubuntu-latest steps: - name: download wheels From 611f6343b653f5430685818bb7e173c3fab9a399 Mon Sep 17 00:00:00 2001 From: ilai Date: Wed, 1 Nov 2023 12:04:24 +0200 Subject: [PATCH 12/39] [CI] Build in the main release job, download in test job Makes more sense - this way we can control the version etc --- .github/workflows/pre-release-CI.yml | 34 +------------------ .github/workflows/release.yml | 49 +++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 42 deletions(-) diff --git a/.github/workflows/pre-release-CI.yml b/.github/workflows/pre-release-CI.yml index fd9e14c2..8a55dca0 100644 --- a/.github/workflows/pre-release-CI.yml +++ b/.github/workflows/pre-release-CI.yml @@ -9,40 +9,8 @@ concurrency: cancel-in-progress: true jobs: - build: - name: Build python${{ matrix.python-version }} - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.9, '3.10', 3.11] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install Poetry - uses: snok/install-poetry@v1 - with: - version: 1.3.2 - - - name: Build wheel - run: | - poetry build - - - name: Upload wheels - uses: actions/upload-artifact@v3 - with: - name: wheels-py${{ matrix.python-version }} - path: ./dist/ - - - build-and-test: + test-installation: name: Test on ${{ matrix.os }}-py${{ matrix.python-version }} - needs: build runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 62f34dc9..9b9403ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,17 +31,48 @@ env: jobs: build: - uses: ./.github/workflows/pre-release-CI.yml - - publish: - needs: build + name: Build python${{ matrix.python-version }} runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ 3.9, '3.10', 3.11 ] + steps: - - name: download wheels - uses: actions/download-artifact@v2 + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Poetry + uses: snok/install-poetry@v1 with: - path: wheels + version: 1.3.2 - - name: debug print wheels + - name: Build wheel run: | - ls -lah wheels/ \ No newline at end of file + poetry build + + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels-py${{ matrix.python-version }} + path: ./dist/ + + test-all-OSes: + needs: build + uses: ./.github/workflows/pre-release-CI.yml + +# publish: +# needs: build +# runs-on: ubuntu-latest +# steps: +# - name: download wheels +# uses: actions/download-artifact@v2 +# with: +# path: wheels +# +# - name: debug print wheels +# run: | +# ls -lah wheels/ \ No newline at end of file From 278be8c4d4891c07455a2fd44db3599d5a7cfe44 Mon Sep 17 00:00:00 2001 From: ilai Date: Wed, 1 Nov 2023 15:23:46 +0200 Subject: [PATCH 13/39] [CI] Added publish job Still partial, WIP --- .github/workflows/pre-release-CI.yml | 2 +- .github/workflows/release.yml | 56 ++++++++++++++++++---------- 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pre-release-CI.yml b/.github/workflows/pre-release-CI.yml index 8a55dca0..310fe2e3 100644 --- a/.github/workflows/pre-release-CI.yml +++ b/.github/workflows/pre-release-CI.yml @@ -57,7 +57,7 @@ jobs: pytest --html=report.html --self-contained-html tests/unit - name: Upload pytest reports - if: always() + if: failure() uses: actions/upload-artifact@v3 with: name: pytest-report-${{ matrix.os }}-py${{ matrix.python-version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b9403ff..c737377a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: 'PyPI Release: Production (pinecone-client)' +name: Release on: workflow_dispatch: @@ -31,25 +31,26 @@ env: jobs: build: - name: Build python${{ matrix.python-version }} + name: Build runs-on: ubuntu-latest - strategy: - matrix: - python-version: [ 3.9, '3.10', 3.11 ] steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: 3.9 # The lowest we support - name: Install Poetry uses: snok/install-poetry@v1 with: version: 1.3.2 + - name: Bump version + - run: | + poetry version ${{ inputs.releaseLevel }} + - name: Build wheel run: | poetry build @@ -57,22 +58,37 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v3 with: - name: wheels-py${{ matrix.python-version }} + name: wheels path: ./dist/ test-all-OSes: needs: build uses: ./.github/workflows/pre-release-CI.yml -# publish: -# needs: build -# runs-on: ubuntu-latest -# steps: -# - name: download wheels -# uses: actions/download-artifact@v2 -# with: -# path: wheels -# -# - name: debug print wheels -# run: | -# ls -lah wheels/ \ No newline at end of file + publish: + needs: test-all-OSes + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: 1.3.2 + + - name: download wheels + uses: actions/download-artifact@v2 + with: + path: ./dist/ + + - name: Commit version update + run: | + git config --global user.name "GitHub Action" + git config --global user.email "relevance@pinecone.io" + git add pyproject.toml + git commit -m "Bump version to $(poetry version -s)" \ No newline at end of file From eaf0bd173f4c5d50df8d7e8e2298f298f9a2994e Mon Sep 17 00:00:00 2001 From: ilai Date: Wed, 1 Nov 2023 15:28:49 +0200 Subject: [PATCH 14/39] TEMP! try to debug --- .github/workflows/release.yml | 54 +++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c737377a..37404c7a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,30 +65,30 @@ jobs: needs: build uses: ./.github/workflows/pre-release-CI.yml - publish: - needs: test-all-OSes - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.9 - - - name: Install Poetry - uses: snok/install-poetry@v1 - with: - version: 1.3.2 - - - name: download wheels - uses: actions/download-artifact@v2 - with: - path: ./dist/ - - - name: Commit version update - run: | - git config --global user.name "GitHub Action" - git config --global user.email "relevance@pinecone.io" - git add pyproject.toml - git commit -m "Bump version to $(poetry version -s)" \ No newline at end of file +# publish: +# needs: test-all-OSes +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# +# - name: Set up Python +# uses: actions/setup-python@v4 +# with: +# python-version: 3.9 +# +# - name: Install Poetry +# uses: snok/install-poetry@v1 +# with: +# version: 1.3.2 +# +# - name: download wheels +# uses: actions/download-artifact@v2 +# with: +# path: ./dist/ +# +# - name: Commit version update +# run: | +# git config --global user.name "GitHub Action" +# git config --global user.email "relevance@pinecone.io" +# git add pyproject.toml +# git commit -m "Bump version to $(poetry version -s)" \ No newline at end of file From e330a8a97d9b002a608b6d9c4d44174efc31fd4b Mon Sep 17 00:00:00 2001 From: ilai Date: Wed, 1 Nov 2023 15:30:58 +0200 Subject: [PATCH 15/39] Try name --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 37404c7a..f817f313 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release +name: 'Release' on: workflow_dispatch: From 82c8e66e9f74939e6c6b5796115c9a25315cdecb Mon Sep 17 00:00:00 2001 From: ilai Date: Wed, 1 Nov 2023 15:31:45 +0200 Subject: [PATCH 16/39] Try input --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f817f313..a65f751c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,9 +47,9 @@ jobs: with: version: 1.3.2 - - name: Bump version - - run: | - poetry version ${{ inputs.releaseLevel }} +# - name: Bump version +# - run: | +# poetry version ${{ inputs.releaseLevel }} - name: Build wheel run: | From f2a6d7534869ccffb47c17930d958a36d677e2ac Mon Sep 17 00:00:00 2001 From: ilai Date: Wed, 1 Nov 2023 15:34:32 +0200 Subject: [PATCH 17/39] Try manual patch --- .github/workflows/release.yml | 60 +++++++++++++++++------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a65f751c..51725157 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,9 +47,9 @@ jobs: with: version: 1.3.2 -# - name: Bump version -# - run: | -# poetry version ${{ inputs.releaseLevel }} + - name: Bump version + - run: | + poetry version ${{ inputs.releaseLevel || 'patch' }} - name: Build wheel run: | @@ -65,30 +65,30 @@ jobs: needs: build uses: ./.github/workflows/pre-release-CI.yml -# publish: -# needs: test-all-OSes -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# -# - name: Set up Python -# uses: actions/setup-python@v4 -# with: -# python-version: 3.9 -# -# - name: Install Poetry -# uses: snok/install-poetry@v1 -# with: -# version: 1.3.2 -# -# - name: download wheels -# uses: actions/download-artifact@v2 -# with: -# path: ./dist/ -# -# - name: Commit version update -# run: | -# git config --global user.name "GitHub Action" -# git config --global user.email "relevance@pinecone.io" -# git add pyproject.toml -# git commit -m "Bump version to $(poetry version -s)" \ No newline at end of file + publish: + needs: test-all-OSes + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: 1.3.2 + + - name: download wheels + uses: actions/download-artifact@v2 + with: + path: ./dist/ + + - name: Commit version update + run: | + git config --global user.name "GitHub Action" + git config --global user.email "relevance@pinecone.io" + git add pyproject.toml + git commit -m "Bump version to $(poetry version -s)" \ No newline at end of file From 150476e93263ee2bba7edd1451c3a86b6e404f12 Mon Sep 17 00:00:00 2001 From: ilai Date: Wed, 1 Nov 2023 15:35:44 +0200 Subject: [PATCH 18/39] bugfix - typo --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51725157..7392522d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,7 +48,7 @@ jobs: version: 1.3.2 - name: Bump version - - run: | + run: | poetry version ${{ inputs.releaseLevel || 'patch' }} - name: Build wheel From 0d4ebdd7243cccd328deed6e8befdfd5c00a21fb Mon Sep 17 00:00:00 2001 From: ilai Date: Wed, 1 Nov 2023 15:39:54 +0200 Subject: [PATCH 19/39] [CI] Bug fix - there's only one `wheels` file WE don't build per OS anymore --- .github/workflows/pre-release-CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-release-CI.yml b/.github/workflows/pre-release-CI.yml index 310fe2e3..9965b0b9 100644 --- a/.github/workflows/pre-release-CI.yml +++ b/.github/workflows/pre-release-CI.yml @@ -39,7 +39,7 @@ jobs: - name: Download wheels uses: actions/download-artifact@v2 with: - name: wheels-py${{ matrix.python-version }} + name: wheels path: ./dist/ - name: Install dev dependencies From 1a3f3b7fda494ecca5a14c3b81d1cbf63785e2fa Mon Sep 17 00:00:00 2001 From: ilai Date: Wed, 1 Nov 2023 16:30:18 +0200 Subject: [PATCH 20/39] [CI] Try re-set version --- .github/workflows/pre-release-CI.yml | 1 + .github/workflows/release.yml | 34 +++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pre-release-CI.yml b/.github/workflows/pre-release-CI.yml index 9965b0b9..b8cfb1d7 100644 --- a/.github/workflows/pre-release-CI.yml +++ b/.github/workflows/pre-release-CI.yml @@ -63,3 +63,4 @@ jobs: name: pytest-report-${{ matrix.os }}-py${{ matrix.python-version }} path: .pytest_cache + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7392522d..b13d427b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,6 +51,11 @@ jobs: run: | poetry version ${{ inputs.releaseLevel || 'patch' }} + - name: Store new version + id: get_version + run: | + echo ::set-output name=version::$(poetry version -s) + - name: Build wheel run: | poetry build @@ -62,6 +67,7 @@ jobs: path: ./dist/ test-all-OSes: + if: never() needs: build uses: ./.github/workflows/pre-release-CI.yml @@ -86,9 +92,35 @@ jobs: with: path: ./dist/ + - name: Set version + run: | + echo ${{ jobs.build.outputs.get_version }} + poetry version ${{ jobs.build.outputs.get_version }} + - name: Commit version update run: | git config --global user.name "GitHub Action" git config --global user.email "relevance@pinecone.io" git add pyproject.toml - git commit -m "Bump version to $(poetry version -s)" \ No newline at end of file + git commit -m "Bump version to $(poetry version -s)" + git push + +# - name: Create tag +# if: ${{ github.event_name == 'workflow_dispatch' && inputs.generateTag == 'true' }} +# run: | +# git tag -a $(poetry version -s) -m "V$(poetry version -s)" +# git push origin "V$(poetry version -s)" + + - name: Create release branch + if: ${{ github.event_name == 'workflow_dispatch' && inputs.generateBranch == 'true' }} + run: | + git checkout -b release/$(poetry version -s) + git push origin release/$(poetry version -s) + + - name: Create release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: "V$(poetry version -s)" + release_name: $(poetry version -s) From 2afb1b88deda322bdf53fb9150d8989b7364358b Mon Sep 17 00:00:00 2001 From: ilai Date: Thu, 2 Nov 2023 12:31:55 +0200 Subject: [PATCH 21/39] [CI] Try job with needs --- .github/workflows/release.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b13d427b..f23a870e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,12 +67,13 @@ jobs: path: ./dist/ test-all-OSes: - if: never() + if: false needs: build uses: ./.github/workflows/pre-release-CI.yml publish: - needs: test-all-OSes +# needs: [build, test-all-OSes] + needs: [build] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -94,8 +95,8 @@ jobs: - name: Set version run: | - echo ${{ jobs.build.outputs.get_version }} - poetry version ${{ jobs.build.outputs.get_version }} + echo ${{ needs.jobs.build.outputs.get_version }} + poetry version ${{ needs.jobs.build.outputs.get_version }} - name: Commit version update run: | From 6805965aa1c5e0dab298c0a9c35ae86e6a2e0bb8 Mon Sep 17 00:00:00 2001 From: ilai Date: Thu, 2 Nov 2023 13:41:35 +0200 Subject: [PATCH 22/39] try env --- .github/workflows/release.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f23a870e..7c196158 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,11 +50,7 @@ jobs: - name: Bump version run: | poetry version ${{ inputs.releaseLevel || 'patch' }} - - - name: Store new version - id: get_version - run: | - echo ::set-output name=version::$(poetry version -s) + echo "CANOPY_VERSION=$(poetry version -s)" >> $GITHUB_ENV - name: Build wheel run: | @@ -95,8 +91,8 @@ jobs: - name: Set version run: | - echo ${{ needs.jobs.build.outputs.get_version }} - poetry version ${{ needs.jobs.build.outputs.get_version }} + echo $CANOPY_VERSION + poetry version $CANOPY_VERSION - name: Commit version update run: | From c51dab903506f9ce5cb1ad07414b6a82a0ef23d1 Mon Sep 17 00:00:00 2001 From: ilai Date: Thu, 2 Nov 2023 14:52:14 +0200 Subject: [PATCH 23/39] [CI] Try outputs Maybe this will work... --- .github/workflows/release.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7c196158..558564e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,8 @@ jobs: build: name: Build runs-on: ubuntu-latest + outputs: + new_version: ${{ steps.bump.outputs.new_version }} steps: - uses: actions/checkout@v3 @@ -50,7 +52,7 @@ jobs: - name: Bump version run: | poetry version ${{ inputs.releaseLevel || 'patch' }} - echo "CANOPY_VERSION=$(poetry version -s)" >> $GITHUB_ENV + echo "new_version=$(poetry version -s)" >> $GITHUB_OUTPUT - name: Build wheel run: | @@ -91,8 +93,8 @@ jobs: - name: Set version run: | - echo $CANOPY_VERSION - poetry version $CANOPY_VERSION + echo ${{ needs.jobs.build.outputs.new_version }} + poetry version ${{ needs.jobs.build.outputs.new_version }} - name: Commit version update run: | From d795bbb18391644a6424eae9b098c20f6fd8bda9 Mon Sep 17 00:00:00 2001 From: ilai Date: Thu, 2 Nov 2023 15:01:21 +0200 Subject: [PATCH 24/39] [CI] Try hardcoded version --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 558564e2..2fab4792 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,9 +50,11 @@ jobs: version: 1.3.2 - name: Bump version + id: bump run: | poetry version ${{ inputs.releaseLevel || 'patch' }} - echo "new_version=$(poetry version -s)" >> $GITHUB_OUTPUT +# echo "new_version=$(poetry version -s)" >> $GITHUB_OUTPUT + echo "new_version=0.2.2" >> $GITHUB_OUTPUT - name: Build wheel run: | From 9abe72bdec060ee67a5f33390e739ed8c1dbf71b Mon Sep 17 00:00:00 2001 From: ilai Date: Thu, 2 Nov 2023 15:04:36 +0200 Subject: [PATCH 25/39] Try using env --- .github/workflows/release.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2fab4792..70a8ed5f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,8 +53,7 @@ jobs: id: bump run: | poetry version ${{ inputs.releaseLevel || 'patch' }} -# echo "new_version=$(poetry version -s)" >> $GITHUB_OUTPUT - echo "new_version=0.2.2" >> $GITHUB_OUTPUT + echo "new_version=$(poetry version -s)" >> $GITHUB_OUTPUT - name: Build wheel run: | @@ -94,9 +93,11 @@ jobs: path: ./dist/ - name: Set version + env: + NEW_VERSION: ${{ needs.build.outputs.new_version }} run: | - echo ${{ needs.jobs.build.outputs.new_version }} - poetry version ${{ needs.jobs.build.outputs.new_version }} + echo $NEW_VERSION + poetry version $NEW_VERSION - name: Commit version update run: | From 66715988fe6bb0896bf98520335216c238511f41 Mon Sep 17 00:00:00 2001 From: ilai Date: Thu, 2 Nov 2023 15:09:57 +0200 Subject: [PATCH 26/39] use the right tag --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 70a8ed5f..26791a9b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -124,5 +124,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: "V$(poetry version -s)" - release_name: $(poetry version -s) + tag_name: V${{ needs.build.outputs.new_version }} + release_name: ${{ needs.build.outputs.new_version }} From eef9246af699c2c7d3a2e66649804649374ed2d6 Mon Sep 17 00:00:00 2001 From: ilai Date: Thu, 2 Nov 2023 15:37:54 +0200 Subject: [PATCH 27/39] Added basic CHANGELOG Will be used for releases --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..e2c3595a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +## [0.1.0] - 2023-10-05 + +- Initial release \ No newline at end of file From 76930752f5c988d32dd6a1d87a8764a473aee400 Mon Sep 17 00:00:00 2001 From: ilai Date: Thu, 2 Nov 2023 15:38:02 +0200 Subject: [PATCH 28/39] [CI] Use changelog + try release pypi --- .github/workflows/release.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 26791a9b..9de7364a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -126,3 +126,13 @@ jobs: with: tag_name: V${{ needs.build.outputs.new_version }} release_name: ${{ needs.build.outputs.new_version }} + artifacts: "dist/*" + bodyFile: "CHANGELOG.md" + + - name: PyPI publish + env: + POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} + POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} + run: | + # poetry config pypi-token.pypi ${{ secrets.PYPI_PASSWORD }} + poetry publish -r https://test.pypi.org/simple From a8f13d8dc6701e6036282fd7a612d508866ecd70 Mon Sep 17 00:00:00 2001 From: ilai Date: Thu, 2 Nov 2023 15:49:29 +0200 Subject: [PATCH 29/39] Try without pypi --- .github/workflows/release.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9de7364a..22973ce8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -127,12 +127,12 @@ jobs: tag_name: V${{ needs.build.outputs.new_version }} release_name: ${{ needs.build.outputs.new_version }} artifacts: "dist/*" - bodyFile: "CHANGELOG.md" + body_file: "CHANGELOG.md" - - name: PyPI publish - env: - POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} - POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} - run: | - # poetry config pypi-token.pypi ${{ secrets.PYPI_PASSWORD }} - poetry publish -r https://test.pypi.org/simple +# - name: PyPI publish +# env: +# POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} +# POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} +# run: | +# # poetry config pypi-token.pypi ${{ secrets.PYPI_PASSWORD }} +# poetry publish -r https://test.pypi.org/simple From 9fda8e3e52e1c2878ccaf2a393a005da4dfa0309 Mon Sep 17 00:00:00 2001 From: ilai Date: Thu, 2 Nov 2023 15:51:04 +0200 Subject: [PATCH 30/39] Try pypi again --- .github/workflows/release.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 22973ce8..460a1ac6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -129,10 +129,10 @@ jobs: artifacts: "dist/*" body_file: "CHANGELOG.md" -# - name: PyPI publish -# env: -# POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} -# POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} -# run: | -# # poetry config pypi-token.pypi ${{ secrets.PYPI_PASSWORD }} -# poetry publish -r https://test.pypi.org/simple + - name: PyPI publish + env: + POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} + POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} + run: | + poetry publish -r https://test.pypi.org/simple +# poetry config pypi-token.pypi ${{ secrets.PYPI_PASSWORD }} From 64b65d7107b52f58623c36d7255d40db7c65fd48 Mon Sep 17 00:00:00 2001 From: ilai Date: Thu, 2 Nov 2023 16:02:23 +0200 Subject: [PATCH 31/39] Debug poetry publish --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 460a1ac6..fd04e9b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -127,12 +127,13 @@ jobs: tag_name: V${{ needs.build.outputs.new_version }} release_name: ${{ needs.build.outputs.new_version }} artifacts: "dist/*" - body_file: "CHANGELOG.md" + body_path: "CHANGELOG.md" - name: PyPI publish env: POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} run: | + ls -la dist/ poetry publish -r https://test.pypi.org/simple # poetry config pypi-token.pypi ${{ secrets.PYPI_PASSWORD }} From fd652a4c5863ec12c4f1bc519bd51c5209a2a025 Mon Sep 17 00:00:00 2001 From: ilai Date: Thu, 2 Nov 2023 16:09:53 +0200 Subject: [PATCH 32/39] [CI] use proper name for download --- .github/workflows/release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fd04e9b4..02f7aea1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -90,6 +90,7 @@ jobs: - name: download wheels uses: actions/download-artifact@v2 with: + name: wheels path: ./dist/ - name: Set version @@ -126,10 +127,10 @@ jobs: with: tag_name: V${{ needs.build.outputs.new_version }} release_name: ${{ needs.build.outputs.new_version }} - artifacts: "dist/*" +# artifacts: "dist/*" body_path: "CHANGELOG.md" - - name: PyPI publish + - name: PyPI publish env: POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} From 24c8a459a510d7c50247bbe09c3df34d9e135201 Mon Sep 17 00:00:00 2001 From: ilai Date: Thu, 2 Nov 2023 16:19:53 +0200 Subject: [PATCH 33/39] [CI] proper test-pypi --- .github/workflows/release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 02f7aea1..22c4e5cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -130,11 +130,10 @@ jobs: # artifacts: "dist/*" body_path: "CHANGELOG.md" - - name: PyPI publish + - name: PyPI publish env: POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} run: | - ls -la dist/ - poetry publish -r https://test.pypi.org/simple + poetry publish -r test-pypi # poetry config pypi-token.pypi ${{ secrets.PYPI_PASSWORD }} From 11a184f8b4e77568bb8ef32e9ff18de48381e68b Mon Sep 17 00:00:00 2001 From: ilai Date: Thu, 2 Nov 2023 16:36:08 +0200 Subject: [PATCH 34/39] [CI] Fix testpypi --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 22c4e5cc..597a278d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -135,5 +135,6 @@ jobs: POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} run: | - poetry publish -r test-pypi + poetry config repositories.testpypi https://test.pypi.org/simple/ + poetry publish -r testpypi # poetry config pypi-token.pypi ${{ secrets.PYPI_PASSWORD }} From 7d4b9158cd47f4c70ae3b89cf2907ff2f3584752 Mon Sep 17 00:00:00 2001 From: ilai Date: Thu, 2 Nov 2023 16:43:12 +0200 Subject: [PATCH 35/39] fix testpypi again --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 597a278d..7767725a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -135,6 +135,6 @@ jobs: POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} run: | - poetry config repositories.testpypi https://test.pypi.org/simple/ + poetry config repositories.testpypi https://test.pypi.org/legacy/ poetry publish -r testpypi # poetry config pypi-token.pypi ${{ secrets.PYPI_PASSWORD }} From 3dc636b5e7d939821770c9fe0e60a8b9b3b15a1d Mon Sep 17 00:00:00 2001 From: ilai Date: Mon, 6 Nov 2023 17:19:14 +0200 Subject: [PATCH 36/39] [CI] Try with different GH release action + pypi token --- .github/workflows/release.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7767725a..c27d6d10 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,8 +25,7 @@ on: push: env: - PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} - PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} + PYPI_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} jobs: @@ -74,6 +73,8 @@ jobs: # needs: [build, test-all-OSes] needs: [build] runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v3 @@ -115,26 +116,23 @@ jobs: # git push origin "V$(poetry version -s)" - name: Create release branch - if: ${{ github.event_name == 'workflow_dispatch' && inputs.generateBranch == 'true' }} +# if: ${{ github.event_name == 'workflow_dispatch' && inputs.generateBranch == 'true' }} run: | git checkout -b release/$(poetry version -s) git push origin release/$(poetry version -s) - name: Create release - uses: actions/create-release@v1 + uses: ncipollo/release-action@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: V${{ needs.build.outputs.new_version }} - release_name: ${{ needs.build.outputs.new_version }} -# artifacts: "dist/*" - body_path: "CHANGELOG.md" + tag: V${{ needs.build.outputs.new_version }} + name: ${{ needs.build.outputs.new_version }} + artifacts: "dist/*" + bodyFile: "CHANGELOG.md" - name: PyPI publish - env: - POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} - POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} run: | poetry config repositories.testpypi https://test.pypi.org/legacy/ - poetry publish -r testpypi -# poetry config pypi-token.pypi ${{ secrets.PYPI_PASSWORD }} + poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }} + poetry publish -r testpypi \ No newline at end of file From 86cecba37973ce4c5a1fd83ae08880329419d3f1 Mon Sep 17 00:00:00 2001 From: ilai Date: Mon, 6 Nov 2023 17:42:17 +0200 Subject: [PATCH 37/39] [CI] Made bump optional + enabled test-pypi as option The CI is now ready --- .github/workflows/release.yml | 53 ++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c27d6d10..ac8ba70c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,13 @@ name: 'Release' on: workflow_dispatch: inputs: - releaseLevel: - description: 'Release level' + bumpVersion: + description: 'Whether to bump the version number' + required: true + type: boolean + default: true + versionLevel: + description: 'Which version level to bump' required: true type: choice default: 'patch' @@ -22,10 +27,11 @@ on: required: true type: boolean default: true - push: - -env: - PYPI_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} + useTestPyPI: + description: 'Whether to use the test PyPI repository' + required: true + type: boolean + default: false jobs: @@ -33,7 +39,7 @@ jobs: name: Build runs-on: ubuntu-latest outputs: - new_version: ${{ steps.bump.outputs.new_version }} + new_version: ${{ steps.store-version.outputs.new_version }} steps: - uses: actions/checkout@v3 @@ -49,9 +55,13 @@ jobs: version: 1.3.2 - name: Bump version - id: bump + if: ${{ inputs.bumpVersion == true }} run: | poetry version ${{ inputs.releaseLevel || 'patch' }} + + - name: Store version number + id: store-version + run: | echo "new_version=$(poetry version -s)" >> $GITHUB_OUTPUT - name: Build wheel @@ -65,13 +75,11 @@ jobs: path: ./dist/ test-all-OSes: - if: false needs: build uses: ./.github/workflows/pre-release-CI.yml publish: -# needs: [build, test-all-OSes] - needs: [build] + needs: [build, test-all-OSes] runs-on: ubuntu-latest permissions: contents: write @@ -96,7 +104,7 @@ jobs: - name: Set version env: - NEW_VERSION: ${{ needs.build.outputs.new_version }} + NEW_VERSION: ${{ needs.store-version.outputs.new_version }} run: | echo $NEW_VERSION poetry version $NEW_VERSION @@ -109,19 +117,13 @@ jobs: git commit -m "Bump version to $(poetry version -s)" git push -# - name: Create tag -# if: ${{ github.event_name == 'workflow_dispatch' && inputs.generateTag == 'true' }} -# run: | -# git tag -a $(poetry version -s) -m "V$(poetry version -s)" -# git push origin "V$(poetry version -s)" - - name: Create release branch -# if: ${{ github.event_name == 'workflow_dispatch' && inputs.generateBranch == 'true' }} + if: ${{ github.event_name == 'workflow_dispatch' && inputs.generateBranch == 'true' }} run: | git checkout -b release/$(poetry version -s) git push origin release/$(poetry version -s) - - name: Create release + - name: Create GH release uses: ncipollo/release-action@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -131,8 +133,15 @@ jobs: artifacts: "dist/*" bodyFile: "CHANGELOG.md" - - name: PyPI publish + - name: Publish to test pypi + if: ${{ inputs.useTestPyPI == 'true' }} run: | poetry config repositories.testpypi https://test.pypi.org/legacy/ poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }} - poetry publish -r testpypi \ No newline at end of file + poetry publish -r testpypi + + - name: Publish to pypi + if: ${{ inputs.useTestPyPI == 'false' }} + run: | + poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} + poetry publish From 88bdca194c658b2f0bbeb31037213f93473b30be Mon Sep 17 00:00:00 2001 From: ilai Date: Mon, 6 Nov 2023 18:05:37 +0200 Subject: [PATCH 38/39] [CI] Commit version change only if version was bumped Otherwise it will error out --- .github/workflows/release.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac8ba70c..fbfd1cba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,11 +22,6 @@ on: required: true type: boolean default: false - generateTag: - description: 'Whether to generate a release tag' - required: true - type: boolean - default: true useTestPyPI: description: 'Whether to use the test PyPI repository' required: true @@ -110,6 +105,7 @@ jobs: poetry version $NEW_VERSION - name: Commit version update + if: ${{ inputs.bumpVersion == true }} run: | git config --global user.name "GitHub Action" git config --global user.email "relevance@pinecone.io" From 7042301c3e899f8ab4941940c3e2b3db057a99c7 Mon Sep 17 00:00:00 2001 From: ilai Date: Mon, 6 Nov 2023 18:19:39 +0200 Subject: [PATCH 39/39] [CI] Revert setting virtualenvs-create to false Not sure if this is really needed --- .github/actions/install-deps-and-canopy/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/install-deps-and-canopy/action.yml b/.github/actions/install-deps-and-canopy/action.yml index 35f7d460..4b8968c0 100644 --- a/.github/actions/install-deps-and-canopy/action.yml +++ b/.github/actions/install-deps-and-canopy/action.yml @@ -17,7 +17,7 @@ runs: uses: snok/install-poetry@v1 with: version: 1.3.2 - virtualenvs-create: no + virtualenvs-create: true virtualenvs-in-project: true installer-parallel: true #----------------------------------------------