70 lines (61 loc) · 1.75 KB
/
rust_publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Rust publish
on:
push:
tags:
- 'r*'
jobs:
wasm-pack:
name: Check if wasm-pack builds a valid package for the sourmash crate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
- uses: actions-rs/cargo@v1
with:
command: install
args: --force wasm-pack --version 0.10.0
- name: run wasm-pack
run: |
wasm-pack build src/core -d ../../pkg
- name: Prepare node for NPM publishing
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Publish to NPM
working-directory: pkg
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
crates:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Make sure we can publish the sourmash crate
uses: actions-rs/cargo@v1
with:
command: publish
args: --dry-run --manifest-path src/core/Cargo.toml
# Login to crates.io on tags
- name: login to crates.io
uses: actions-rs/cargo@v1
with:
command: login
args: ${{ secrets.CRATES_IO_TOKEN }}
# Publish to crates.io on tags
- name: Publish to crates.io
uses: actions-rs/cargo@v1
with:
command: publish
args: --manifest-path src/core/Cargo.toml