Release packages #2
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
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
name: Release packages | |
jobs: | |
release-crate: | |
name: release to crates.io | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v2 | |
- name: install rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: cargo publish yrs | |
run: cd ./yrs && cargo publish --all-features --token ${CRATES_TOKEN} | |
env: | |
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
- name: cargo publish yffi | |
run: sleep 20 && cd ./yffi && cargo publish --token ${CRATES_TOKEN} | |
env: | |
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
- name: cargo publish ywasm | |
run: sleep 20 && cd ./ywasm && cargo publish --token ${CRATES_TOKEN} | |
env: | |
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
release-npm: | |
name: release to npmjs.org | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v2 | |
- name: install rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: install nodejs | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
registry-url: 'https://registry.npmjs.org' | |
- name: install wasm-pack | |
uses: jetli/[email protected] | |
with: | |
version: 'latest' | |
- name: build wasm | |
run: wasm-pack build --release --target nodejs ./ywasm | |
- name: npm publish | |
run: cd ./ywasm/pkg && npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |