Skip to content

Commit

Permalink
Merge pull request #106 from Koukyosyumei/release001
Browse files Browse the repository at this point in the history
0.0.1-alpha.1
  • Loading branch information
Koukyosyumei authored Jan 2, 2023
2 parents 59c897f + ec4d899 commit 45deec1
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 35 deletions.
81 changes: 56 additions & 25 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
push:
branches:
- main
- main
release:
types:
- published
Expand All @@ -15,36 +15,67 @@ jobs:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Build SDist
run: pipx run build --sdist
- uses: actions/checkout@v3
with:
submodules: true

- name: Check metadata
run: pipx run twine check dist/*
- name: Build SDist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
- name: Check metadata
run: pipx run twine check dist/*

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

build_wheels:
name: Wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Install Boost
run: sudo apt install -y libboost-all-dev

- name: Build wheels
run: |
pip install "pybind11[global]"
pip install build
python -m build
- name: Verify clean directory
run: git diff --exit-code
shell: bash

- name: Upload wheels
uses: actions/upload-artifact@v3
with:
path: dist/*.whl

upload_all:
name: Upload if release
needs: [build_sdist]
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/setup-python@v4
with:
python-version: "3.x"

- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_PASSWORD }}
- uses: actions/setup-python@v4
with:
python-version: "3.x"

- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_PASSWORD }}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ find_package(Boost REQUIRED)

find_package(Python COMPONENTS Interpreter Development)
find_package(pybind11 CONFIG)
pybind11_add_module(aijack_cpp_core main.cpp)
pybind11_add_module(aijack_cpp_core src/main.cpp)

# EXAMPLE_VERSION_INFO is defined by setup.py and passed into the C++ code as a
# define (VERSION_INFO) here.
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include README.md LICENSE
graft src
global-include CMakeLists.txt *.cmake
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
[project]

name = "aijack"
version = "0.0.1"
version = "0.0.1-alpha.1"
authors = [
{ name="Hideaki Takahashi" },
]
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ def read_requirements():
return requirements


__version__ = "0.0.1"
__version__ = "0.0.1-alpha.1"
ext_modules = [CMakeExtension("aijack_cpp_core")]
console_scripts = []

setup(
name="aijack",
version="0.0.1",
version="0.0.1-alpha.1",
ext_modules=ext_modules,
entry_points={"console_scripts": console_scripts},
cmdclass={"build_ext": CMakeBuild},
Expand Down
12 changes: 6 additions & 6 deletions main.cpp → src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
#include <iostream>
#include <vector>

#include "src/aijack/defense/dp/core//rdp.cpp"
#include "src/aijack/defense/dp/core//search.cpp"
#include "src/aijack/defense/paillier/src/paillier.h"
#include "src/aijack/defense/paillier/src/keygenerator.h"
#include "src/aijack/collaborative/tree/xgboost/xgboost.h"
#include "src/aijack/collaborative/tree/secureboost/secureboost.h"
#include "aijack/defense/dp/core//rdp.cpp"
#include "aijack/defense/dp/core//search.cpp"
#include "aijack/defense/paillier/src/paillier.h"
#include "aijack/defense/paillier/src/keygenerator.h"
#include "aijack/collaborative/tree/xgboost/xgboost.h"
#include "aijack/collaborative/tree/secureboost/secureboost.h"

#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
Expand Down

0 comments on commit 45deec1

Please sign in to comment.