-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from YM162/rust_bindings
Changed code to Rust and added bindings for Python and JS (via WASM).
- Loading branch information
Showing
40 changed files
with
5,703 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Publish to crates registry | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Publish to crates registry | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: cargo publish -p gulagcleaner_rs --token ${CARGO_REGISTRY_TOKEN} | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: Bind from Python/Build wheels and publish to PyPI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
name: build py3.${{ matrix.python-version }} on ${{ matrix.platform || matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu | ||
- macos | ||
- windows | ||
python-version: | ||
- '7' | ||
- '8' | ||
- '9' | ||
include: | ||
- os: ubuntu | ||
platform: linux | ||
- os: windows | ||
ls: dir | ||
|
||
runs-on: ${{ format('{0}-latest', matrix.os) }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: set up python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: set up rust | ||
if: matrix.os != 'ubuntu' | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
|
||
- name: install python dependencies | ||
run: pip install -U setuptools wheel twine cibuildwheel build | ||
|
||
- name: build sdist | ||
working-directory: gulagcleaner_python | ||
if: matrix.os == 'ubuntu' && matrix.python-version == '8' | ||
run: | | ||
pip install -U setuptools-rust | ||
python -m build . --sdist | ||
- name: build ${{ matrix.platform || matrix.os }} binaries | ||
run: cibuildwheel gulagcleaner_python --output-dir dist | ||
env: | ||
CIBW_BUILD: 'cp3${{ matrix.python-version }}-*' | ||
CIBW_SKIP: '*-win32 *-musllinux_i686' | ||
CIBW_PLATFORM: ${{ matrix.platform || matrix.os }} | ||
CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH"' | ||
CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"' | ||
CIBW_MANYLINUX_X86_64_IMAGE: 'manylinux2014' | ||
CIBW_MANYLINUX_I686_IMAGE: 'manylinux2014' | ||
CIBW_BEFORE_BUILD: > | ||
pip install -U setuptools-rust && | ||
rustup default nightly && | ||
rustup show | ||
CIBW_BEFORE_BUILD_LINUX: > | ||
pip install -U setuptools-rust && | ||
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=nightly --profile=minimal -y && | ||
rustup show | ||
- name: build windows 32bit binaries | ||
if: matrix.os == 'windows' | ||
run: cibuildwheel gulagcleaner_python --output-dir dist | ||
env: | ||
CIBW_BUILD: 'cp3${{ matrix.python-version }}-win32' | ||
CIBW_PLATFORM: windows | ||
CIBW_ENVIRONMENT: 'PATH="$UserProfile\.cargo\bin;$PATH"' | ||
CIBW_BEFORE_BUILD: > | ||
pip install -U setuptools-rust && | ||
rustup toolchain install nightly-i686-pc-windows-msvc && | ||
rustup default nightly-i686-pc-windows-msvc && | ||
rustup override set nightly-i686-pc-windows-msvc && | ||
rustup show | ||
- name: list dist files | ||
run: ${{ matrix.ls || 'ls -lh' }} dist/ | ||
|
||
- name: twine check | ||
run: twine check dist/* | ||
|
||
- name: upload to pypi | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: twine upload dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.pypi_token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Build as WASM and publish in npm | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Build and publish to npm | ||
steps: | ||
- name: git-checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: install wasm-pack | ||
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | ||
|
||
- name: build wasm | ||
run: wasm-pack build gulagcleaner_wasm --target web --release -d WASM_build | ||
|
||
- name: setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: run install | ||
working-directory: ./gulagcleaner_wasm/WASM_build | ||
run: npm install | ||
|
||
- name: publish to npm | ||
working-directory: ./gulagcleaner_wasm/WASM_build | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.