Skip to content

Commit

Permalink
v0.21.3; fix gh release (#1554)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaiton authored Jun 21, 2024
1 parent 8eb1294 commit 443f163
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 18 deletions.
40 changes: 31 additions & 9 deletions .github/workflows/build_and_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down
9 changes: 1 addition & 8 deletions scripts/build_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
python -m build
15 changes: 15 additions & 0 deletions scripts/generate_deps.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 443f163

Please sign in to comment.