Skip to content

Commit

Permalink
GA-167 | public release prep (#30)
Browse files Browse the repository at this point in the history
* GA-167 | initial commit

* attempt: remove `setup_ssh`

* remove: `setup_sa`

* update `pyproject`

* new: `release` github action

* ls dist

(we're not actually releasing anything right now)

* attempt: macos amd & arm

* cleanup

* fix: `libssl-dev`

* simplify

* attempt: use powershell

* remove: `publish`

* attempt: `universal2`

* attempt: `maturin build`

* remove: `release_package`

* attempt: `rustup`

* move: `rustup`

* attempt: `x64`

* attempt: macos-latest, macos-12

* attempt: go back to CFLAGS

* attempt: macos-13

* remove: `.cargo`

* remove: `benchmarks` & unused dockerfile

* new: `twine upload` to test pypi

* attempt: trigger `0.5.0` release to test pypi

* attempt: trigger `0.5.1` release to test pypi

using verbose to debug, and disabling python matrix

* attempt: trigger `0.5.2` release to test pypi

use maturin build, only upload whl files

* attempt: trigger `0.5.3` release to test pypi

using Dockerfile-build for `build-linux`

* attempt: trigger `0.5.4` release to pypi

* fix: python-version

* cleanup
  • Loading branch information
aMahanna authored Aug 14, 2024
1 parent 156b860 commit cb69116
Show file tree
Hide file tree
Showing 10 changed files with 125 additions and 164 deletions.
2 changes: 0 additions & 2 deletions .cargo/config.toml

This file was deleted.

47 changes: 0 additions & 47 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,13 @@ workflows:
parameters:
db-mode: ["single", "cluster"]
db-version: ["3.10", "3.11", "3.12"]
release_package:
jobs:
- publish:
context: agml-pypi
filters:
tags:
only:
- /^v.*/
branches:
ignore: /.*/

commands:
setup_ssh:
steps:
- add_ssh_keys:
fingerprints:
- "SHA256:XsmQvjXDygXfd3z0ynvv6lcOEHjO4iJBGHFtZkk753Q"
- run:
name: Add GitHub to known_hosts
command: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts

jobs:
lint-python:
docker:
- image: cimg/python:3.10
steps:
- checkout
- setup_ssh
- restore_cache:
key: py_lint_cache
- run: |
Expand All @@ -77,7 +54,6 @@ jobs:
- image: cimg/rust:1.75
steps:
- checkout
- setup_ssh
- run:
name: Install clippy
command: rustup component add clippy
Expand All @@ -94,7 +70,6 @@ jobs:
executor: generate-executor
steps:
- checkout
- setup_ssh
- run:
name: Build builder image
command: docker build -t phenolrs-builder:latest -f Dockerfile-build .
Expand All @@ -111,7 +86,6 @@ jobs:
- image: cimg/rust:1.75
steps:
- checkout
- setup_ssh
- run:
name: Setup lib
command: |
Expand All @@ -131,7 +105,6 @@ jobs:
executor: generate-executor
steps:
- checkout
- setup_ssh
- attach_workspace:
at: ~/project/target
- run:
Expand Down Expand Up @@ -172,23 +145,3 @@ jobs:
conda activate phenolrs
export RUST_BACKTRACE=1
pytest --url http://172.28.0.1:8529 python/tests
publish:
executor: generate-executor
steps:
- checkout
- setup_ssh
- run:
name: Build builder image
command: docker build -t phenolrs-builder:latest -f Dockerfile-build .
- run:
name: Build package
command: docker run --rm -v $(pwd):/io phenolrs-builder:latest build --release --interpreter python3.10 python3.11 python3.12 --sdist
- run:
name: Install release packages
command: pip install twine
- run:
name: Setup SA
command: ./setup_sa.sh "${PYTHON_REPO_ID}" "${PYTHON_REPO_URL}" "${PYPI_ACCOUNT_USER}" "${PYPI_ACCOUNT_KEY}" "${PYTHON_INDEX_URL}"
- run:
name: Publish Package
command: twine upload --verbose --repository "${PYTHON_REPO_ID}" target/wheels/*
117 changes: 117 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Release Phenolrs

on:
workflow_dispatch:
release:
types: [published]

jobs:
release-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libssl-dev
pip install build maturin twine
- name: Build builder image
run: docker build -t phenolrs-builder:latest -f Dockerfile-build .

- name: Build the package
run: docker run --rm -v $(pwd):/io phenolrs-builder:latest build --out dist --release --sdist --interpreter python3.10 python3.11 python3.12

- name: ls
run: ls dist/*

- name: Publish to Test PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }}
run: twine upload --verbose --repository testpypi dist/*.whl

- name: Publish to PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: twine upload --verbose --repository pypi dist/*.whl

release-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: pip install build maturin twine

- name: Build the package
run: maturin build --out dist --release --sdist --interpreter python3.10 python3.11 python3.12

- name: ls
run: ls dist/*

- name: Publish to Test PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }}
run: twine upload --verbose --repository testpypi dist\*.whl

- name: Publish to PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: twine upload --verbose --repository pypi dist\*.whl

release-macos:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, macos-13]

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: |
brew install openssl
pip install build maturin twine
- name: Build the package
run: |
if [[ "${{ matrix.os }}" == "macos-13" ]]; then
maturin build --out dist --release --sdist --target x86_64-apple-darwin --interpreter python3.10 python3.11 python3.12
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
maturin build --out dist --release --sdist --target aarch64-apple-darwin --interpreter python3.10 python3.11 python3.12
fi
- name: ls
run: ls dist/*

- name: Publish to Test PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }}
run: twine upload --verbose --repository testpypi dist/*.whl

- name: Publish to PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: twine upload --verbose --repository pypi dist/*.whl
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "phenolrs"
version = "0.4.2"
version = "0.5.4"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
15 changes: 0 additions & 15 deletions Dockerfile

This file was deleted.

38 changes: 0 additions & 38 deletions benchmarks/adb_cloud.py

This file was deleted.

36 changes: 0 additions & 36 deletions benchmarks/local.py

This file was deleted.

7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ build-backend = "maturin"

[project]
name = "phenolrs"
requires-python = ">=3.8"
version = "0.5.4"
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Typing :: Typed",
]
dependencies = [
"numpy~=1.26",
Expand Down
23 changes: 0 additions & 23 deletions setup_sa.sh

This file was deleted.

0 comments on commit cb69116

Please sign in to comment.