mirror of
https://github.com/mii443/tokenizers.git
synced 2025-08-22 16:25:30 +00:00
* Update docs-check.yml Bump actions/setup-python to v5 Bump python-version to 3.12 (default on ubuntu-latest) Switch actions-rs/toolchain to dtolnay/rust-toolchain as the former one is no longer maintained * Update node-release.yml Bump actions/setup-python to v5 Switch actions-rs/toolchain to dtolnay/rust-toolchain as the former one is no longer maintained Bump actions/cache to v4 Bump actions/setup-node to v4 Bump actions/upload-artifact to v4 Bump actions/download-artifact to v4 * Update node.yml Switch actions-rs/toolchain to dtolnay/rust-toolchain as the former one is no longer maintained Bump actions/cache to v4 Bump actions/setup-node to v4 * Update python-release-conda.yml Switch actions-rs/toolchain to dtolnay/rust-toolchain as the former one is no longer maintained Bump conda-incubator/setup-miniconda to v3 * Update python-release.yml Bump actions/setup-python to v5 Bump actions/download-artifact to v4 * Update rust-release.yml Switch actions-rs/toolchain to dtolnay/rust-toolchain as the former one is no longer maintained Bump actions/cache to v4 * Update stale.yml Bump actions/stale to v9 * Update python.yml Bump actions/setup-python to v5
107 lines
3.0 KiB
YAML
107 lines
3.0 KiB
YAML
name: Node Release
|
|
|
|
env:
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
AWS_DEFAULT_REGION: us-east-1
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- node-v*
|
|
|
|
jobs:
|
|
build:
|
|
env:
|
|
MACOSX_DEPLOYMENT_TARGET: 10.11
|
|
strategy:
|
|
matrix:
|
|
settings:
|
|
- host: macos-latest
|
|
target: x86_64-apple-darwin
|
|
- host: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
- host: ubuntu-latest
|
|
target: x86_64-unknown-linux-gnu
|
|
runs-on: ${{ matrix.settings.host }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
# Necessary for now for the cargo cache: https://github.com/actions/cache/issues/133#issuecomment-599102035
|
|
- if: matrix.os == 'ubuntu-latest'
|
|
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
|
|
|
|
- name: Cache Cargo Registry
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cargo/registry
|
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
- name: Install Node ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: latest
|
|
cache: yarn
|
|
cache-dependency-path: ./bindings/node/
|
|
|
|
- name: Install npm dependencies
|
|
working-directory: ./bindings/node
|
|
run: yarn install
|
|
|
|
- name: Build and package rust
|
|
working-directory: ./bindings/node
|
|
run: |
|
|
yarn build &&
|
|
strip -x *.node
|
|
|
|
- name: Install Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: 3.x
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: bindings-${{ matrix.settings.target }}
|
|
path: ${{ env.APP_NAME }}bindings/node/*.node
|
|
if-no-files-found: error
|
|
publish:
|
|
name: Publish
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- build
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: latest
|
|
check-latest: true
|
|
cache: yarn
|
|
cache-dependency-path: ./bindings/node/
|
|
- name: Install dependencies
|
|
working-directory: ./bindings/node
|
|
run: yarn install
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: ./bindings/node/artifacts
|
|
- name: Move artifacts
|
|
working-directory: ./bindings/node
|
|
run: yarn artifacts
|
|
- name: List packages
|
|
working-directory: ./bindings/node
|
|
run: ls -R ./npm
|
|
shell: bash
|
|
- name: Publish
|
|
working-directory: ./bindings/node
|
|
run: |
|
|
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
|
npm publish --access public --tag next
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|