From 0ee86d9faffb9bf6ca02642ee187d3e0ad52d09f Mon Sep 17 00:00:00 2001 From: Merwane Hamadi Date: Sun, 23 Jul 2023 09:15:31 -0700 Subject: [PATCH 1/2] Update publish_package.yml --- .github/workflows/publish_package.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_package.yml b/.github/workflows/publish_package.yml index 501611bdfcb..a83ce7b6c18 100644 --- a/.github/workflows/publish_package.yml +++ b/.github/workflows/publish_package.yml @@ -20,9 +20,25 @@ jobs: run: | curl -sSL https://install.python-poetry.org | python3 - echo "$HOME/.poetry/bin" >> $GITHUB_PATH + - name: Build project for distribution + run: poetry build - name: Install dependencies run: poetry install + - name: Check Version + id: check-version + run: | + echo version=$(poetry version --short) >> $GITHUB_OUTPUT + + - name: Create Release + uses: ncipollo/release-action@v1 + with: + artifacts: "dist/*" + token: ${{ secrets.GITHUB_TOKEN }} + draft: false + generateReleaseNotes: true + tag: v${{ steps.check-version.outputs.version }} + commit: master - name: Build and publish - run: poetry publish --build -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} + run: poetry publish -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} From dbfd1b886cfcbd7fde74aa8356edecd4eadfb716 Mon Sep 17 00:00:00 2001 From: Merwane Hamadi Date: Sun, 23 Jul 2023 12:01:57 -0700 Subject: [PATCH 2/2] Make spreadsheet dynamic --- .github/workflows/ci.yml | 1 + send_to_googledrive.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c638c812c0..15c7bf5e2df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -206,3 +206,4 @@ jobs: fi env: GDRIVE_BASE64: ${{ secrets.GDRIVE_BASE64 }} + GITHUB_REF_NAME: ${{ github.ref_name }} diff --git a/send_to_googledrive.py b/send_to_googledrive.py index aa074ea6acb..0e2cebe5a0e 100644 --- a/send_to_googledrive.py +++ b/send_to_googledrive.py @@ -94,7 +94,8 @@ client = gspread.authorize(creds) # Get the instance of the Spreadsheet -sheet = client.open("benchmark") +branch_name = os.getenv("GITHUB_REF_NAME") +sheet = client.open(f"benchmark-{branch_name}") # Get the first sheet of the Spreadsheet sheet_instance = sheet.get_worksheet(0)