ci: add rust github actions workflow #30
Workflow file for this run
This file contains hidden or 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
| name: Publish Packages | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build_wheels: | |
| name: Build Python wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v2.22.0 | |
| env: | |
| CIBW_ARCHS_MACOS: x86_64 arm64 | |
| CIBW_SKIP: "pp* cp38-macosx_arm64" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact | |
| path: ./wheelhouse/*.whl | |
| publish_pypi: | |
| needs: [build_wheels] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: artifact | |
| path: dist | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| publish_npm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18.x' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install Emscripten | |
| run: | | |
| git clone --depth 1 https://github.com/emscripten-core/emsdk.git | |
| cd emsdk && ./emsdk install latest && ./emsdk activate latest | |
| - name: Build WASM | |
| run: | | |
| source emsdk/emsdk_env.sh | |
| cd js | |
| node build.js | |
| - name: Publish to NPM | |
| run: | | |
| cp README.md js/ | |
| cd js | |
| npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |