From 443f16361c4189d999f7ecd3c7f4b009d12c3828 Mon Sep 17 00:00:00 2001 From: Dylan Paiton Date: Thu, 20 Jun 2024 17:52:31 -0700 Subject: [PATCH] v0.21.3; fix gh release (#1554) --- .github/workflows/build_and_upload.yml | 40 ++++++++++++++++++++------ pyproject.toml | 2 +- scripts/build_wheels.sh | 9 +----- scripts/generate_deps.sh | 15 ++++++++++ 4 files changed, 48 insertions(+), 18 deletions(-) create mode 100644 scripts/generate_deps.sh diff --git a/.github/workflows/build_and_upload.yml b/.github/workflows/build_and_upload.yml index 3c0db720e..7c98aa2b6 100644 --- a/.github/workflows/build_and_upload.yml +++ b/.github/workflows/build_and_upload.yml @@ -33,12 +33,6 @@ jobs: name: wheels-linux path: dist/*.whl - - name: Upload the package versions as an artifact - uses: actions/upload-artifact@v4 - with: - name: frozen-dependencies - path: dist/frozen-requirements.txt - build-sdist: name: Build source distribution runs-on: ubuntu-latest @@ -67,6 +61,36 @@ jobs: pattern: wheels-* path: dist merge-multiple: true + - name: Upload to pypi + uses: pypa/gh-action-pypi-publish@release/v1 + + generate-dependencies: + needs: [upload_pypi] + name: generate dependency file + runs-on: ubuntu-latest + steps: + - name: set up python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + token: ${{github.token}} + + - name: generate dependency file + shell: bash + run: source scripts/generate_deps.sh + + - name: upload dependency file + uses: actions/upload-artifact@v4 + with: + name: frozen-dependencies + path: dist/frozen-requirements.txt + + upload-dependencies: + needs: [generate-dependencies] + runs-on: ubuntu-latest + permissions: + contents: write + steps: - name: Download dependency list artifact uses: actions/download-artifact@v4 with: @@ -77,6 +101,4 @@ jobs: GH_TOKEN: ${{ github.token }} shell: bash run: | - gh release upload ${{ github.ref_name }} ./frozen-requirements.txt - - name: Upload to pypi - uses: pypa/gh-action-pypi-publish@release/v1 + gh release upload ${{ github.ref_name }} ./dist/frozen-requirements.txt diff --git a/pyproject.toml b/pyproject.toml index 347ef7561..b06a5baeb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "agent0" -version = "0.21.2" +version = "0.21.3" # Authors are the current, primary stewards of the repo # contributors can be found on github authors = [ diff --git a/scripts/build_wheels.sh b/scripts/build_wheels.sh index 5982cd820..147e59e1a 100644 --- a/scripts/build_wheels.sh +++ b/scripts/build_wheels.sh @@ -9,11 +9,4 @@ source .venv/bin/activate pip install '.[all]' build echo "build the wheel for the current platform" -python -m build - -# Export dependency versions used to build the wheel -FREEZE_FILE="dist/frozen-requirements.txt" -timestamp="$(date)" -version="$(git describe --abbrev=12 --always)" -echo -e "# Generated at $timestamp ($version)\n" > $FREEZE_FILE -pip3 freeze | tee -a $FREEZE_FILE \ No newline at end of file +python -m build \ No newline at end of file diff --git a/scripts/generate_deps.sh b/scripts/generate_deps.sh new file mode 100644 index 000000000..05184af4a --- /dev/null +++ b/scripts/generate_deps.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# agent0 install +echo "install required packages for building wheels" +python -m pip install --upgrade pip +python -m venv --upgrade-deps .venv +source .venv/bin/activate +pip install agent0 + +# Export dependency versions used to build the wheel +FREEZE_FILE="dist/frozen-requirements.txt" +timestamp="$(date)" +version="$(git describe --abbrev=12 --always)" +echo -e "# Generated at $timestamp ($version)\n" > $FREEZE_FILE +pip3 freeze | tee -a $FREEZE_FILE \ No newline at end of file