Publish new versions #18
Workflow file for this run
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
name: 'Publish new versions' | |
on: | |
push: | |
tags: | |
- v[0-9]+.* | |
jobs: | |
rust: | |
name: Publish to crates.io | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Publish package to Crates | |
run: cargo publish --manifest-path entab/Cargo.toml --token ${CRATES_API_TOKEN} | |
env: | |
CRATES_API_TOKEN: ${{ secrets.CRATES_API_TOKEN }} | |
python: | |
name: Publish to PyPI | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64 | |
- os: ubuntu-latest | |
target: armv7 | |
- os: macos-latest | |
target: x64 | |
- os: windows-latest | |
target: x64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
default: true | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.6 | |
architecture: x64 | |
- name: build the wheels | |
uses: messense/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
manylinux: auto | |
args: --release --out dist --no-sdist -m entab-py/Cargo.toml --cargo-extra-args=--features=maturin | |
- name: upload the wheels | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
pip install --upgrade twine | |
twine upload --skip-existing dist/* | |
javascript: | |
name: Publish to NPM | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
default: true | |
- uses: actions/setup-node@v2 | |
with: | |
registry-url: 'https://registry.npmjs.org' | |
- name: install wasm-pack | |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: build the package | |
run: wasm-pack build --release ./entab-js/ | |
- name: fix the package name | |
run: sed -i.bak "s/entab-js/entab/" entab-js/pkg/package.json | |
- run: rm ./entab-js/pkg/package.json.bak | |
- name: publish to npm | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_API_TOKEN }} | |
run: npm publish --access public ./entab-js/pkg/ | |