mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-26 19:45:54 +03:00
Add Travis/AppVeyor deployments
This commit is contained in:
parent
ddf27f0ab1
commit
1db5b3fb50
@ -1,7 +1,14 @@
|
|||||||
|
environment:
|
||||||
|
global:
|
||||||
|
RUSTFLAGS: -Zunstable-options -Ctarget-feature=+crt-static
|
||||||
|
matrix:
|
||||||
|
- TARGET: x86_64-pc-windows-msvc
|
||||||
|
DEPLOY: 1
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- ps: Install-Product node 9
|
- ps: Install-Product node 9
|
||||||
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
|
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
|
||||||
- if not defined RUSTFLAGS rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain nightly
|
- rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain nightly
|
||||||
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
|
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
|
||||||
- rustc -V
|
- rustc -V
|
||||||
- cargo -V
|
- cargo -V
|
||||||
@ -12,4 +19,27 @@ test_script:
|
|||||||
- rustup target add wasm32-unknown-unknown
|
- rustup target add wasm32-unknown-unknown
|
||||||
- yarn
|
- yarn
|
||||||
- cargo test
|
- cargo test
|
||||||
- cargo install --debug --path crates/wasm-bindgen-cli
|
- cargo build --release -p wasm-bindgen-cli
|
||||||
|
|
||||||
|
before_deploy:
|
||||||
|
- ps: |
|
||||||
|
$NAME = "wasm-bindgen-${env:APPVEYOR_REPO_TAG_NAME}-${env:TARGET}"
|
||||||
|
New-Item -Path $NAME -ItemType directory
|
||||||
|
Copy-Item target/release/wasm-bindgen.exe "${NAME}/"
|
||||||
|
Copy-Item target/release/wasm2es6js.exe "${NAME}/"
|
||||||
|
Copy-Item LICENSE-MIT "${NAME}/"
|
||||||
|
Copy-Item LICENSE-APACHE "${NAME}/"
|
||||||
|
Copy-Item README.md "${NAME}/"
|
||||||
|
7z a -ttar "${NAME}.tar" "${NAME}"
|
||||||
|
7z a "${NAME}.tar.gz" "${NAME}.tar"
|
||||||
|
Push-AppveyorArtifact "${NAME}.tar.gz"
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
artifact: /.*\.tar.gz/
|
||||||
|
auth_token:
|
||||||
|
secure: dtHSvbZkdAFtL0J5YrSw8DpxjfYuHWgqD1SupmJT/yfYSjEBiX55RFXRoqBM2tx1
|
||||||
|
description: ''
|
||||||
|
on:
|
||||||
|
appveyor_repo_tag: true
|
||||||
|
provider: GitHub
|
||||||
|
|
||||||
|
35
.travis.yml
35
.travis.yml
@ -3,8 +3,25 @@ sudo: false
|
|||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
# CLI builds on stable
|
||||||
|
- rust: stable
|
||||||
|
install: true
|
||||||
|
script: cargo build -p wasm-bindgen-cli
|
||||||
|
|
||||||
|
# Tests pass on nightly
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
|
|
||||||
|
# Dist linux binary
|
||||||
|
- env: TARGET=x86_64-unknown-linux-musl DEPLOY=1
|
||||||
|
before_script: rustup target add $TARGET
|
||||||
|
script: cargo build -p wasm-bindgen-cli --release --target $TARGET
|
||||||
|
|
||||||
|
# Dist OSX binary
|
||||||
|
- os: osx
|
||||||
|
env: MACOSX_DEPLOYMENT_TARGET=10.7 DEPLOY=1 TARGET=x86_64-apple-darwin
|
||||||
|
script: cargo build -p wasm-bindgen-cli --release --target $TARGET
|
||||||
|
before_install: brew install yarn --without-node
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
|
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
|
||||||
- source ~/.nvm/nvm.sh
|
- source ~/.nvm/nvm.sh
|
||||||
@ -26,3 +43,21 @@ notifications:
|
|||||||
email:
|
email:
|
||||||
on_success: never
|
on_success: never
|
||||||
|
|
||||||
|
before_deploy:
|
||||||
|
- name="wasm-bindgen-$TRAVIS_TAG-$TARGET"
|
||||||
|
- mkdir $name
|
||||||
|
- cp target/$TARGET/release/{wasm-bindgen,wasm2es6js} $name/
|
||||||
|
- cp README.md LICENSE-MIT LICENSE-APACHE $name/
|
||||||
|
- tar czvf $name.tar.gz $name
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
api_key:
|
||||||
|
secure: "qCiELnEnvyKpWHDttgTNf+ElZGbWlvthu5aOIj5nYfov+h6g1+mkWnDFP6at/WPlE78zE/f/z/dL2KB2I7w/cxH/T4P1nWh0A9DvrpY6hqWkK2pgN5dPeWE/a4flI7AdH0A6wMRw7m00uMgDjlzN78v7XueccpJCxSO5allQN5jweAQvMX2QA07TbLRJc7Lq6lfVwSf8OfrcO8qCbcIzJTsC4vtbh6jkUYg1OAaU2tAYlskBy9ZYmHWCExIAu/zxzcJY9OpApPD9Ea4CyrsfjniAyRBJ87Weh/sP4XhiWeRPVmvA4HAzv4Pps9ps+Ar5QmsX53rhKQ3id7/VPR8ggaAHxrYUiJPvJRtbP6cKKOlDiK0ooP+vI4vjxWeNVj9ibEolSYOlT0ENIvPK1BppA6VgAoJOjwPr0Q16Ma4AmvLkIkowJiXCm2Jlje/5c0vPEAGJVgUtkj3jFQzgXwyEMpzxUlhHmYpmnfeaM0tK/Kiiwe1monL/ydMlyfV55kNylylCg+XoTnf420AFChKbD4DM5Z7ZsjU9g8fF3LUoN0sKpmLDp+GvwjLi9YtGogWB71Q2MFp43MSL0YLshkyYYoZKrVMiy5J9hKNUxhT2jNEq53Z69syIHHMCxHL9GoAcuHxIKOA7uTMW0aCoyy2I+dfAKKsrUGwGYaNC5LZdUQI="
|
||||||
|
file_glob: true
|
||||||
|
file:
|
||||||
|
- wasm-bindgen-$TRAVIS_TAG-$TARGET.tar.gz
|
||||||
|
on:
|
||||||
|
condition: $DEPLOY = 1
|
||||||
|
tags: true
|
||||||
|
provider: releases
|
||||||
|
skip_cleanup: true
|
||||||
|
@ -5,7 +5,6 @@ authors = ["Alex Crichton <alex@alexcrichton.com>"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
base64 = "0.9"
|
base64 = "0.9"
|
||||||
failure = "0.1"
|
|
||||||
parity-wasm = "0.27"
|
parity-wasm = "0.27"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
wasm-bindgen-shared = { path = "../wasm-bindgen-shared" }
|
wasm-bindgen-shared = { path = "../wasm-bindgen-shared" }
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#[macro_use]
|
|
||||||
extern crate failure;
|
|
||||||
extern crate parity_wasm;
|
extern crate parity_wasm;
|
||||||
extern crate wasm_bindgen_shared as shared;
|
extern crate wasm_bindgen_shared as shared;
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
@ -11,7 +9,6 @@ use std::io::Write;
|
|||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::slice;
|
use std::slice;
|
||||||
|
|
||||||
use failure::Error;
|
|
||||||
use parity_wasm::elements::*;
|
use parity_wasm::elements::*;
|
||||||
|
|
||||||
mod js;
|
mod js;
|
||||||
@ -24,6 +21,15 @@ pub struct Bindgen {
|
|||||||
typescript: bool,
|
typescript: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct Error(String);
|
||||||
|
|
||||||
|
impl<E: std::error::Error> From<E> for Error {
|
||||||
|
fn from(e: E) -> Error {
|
||||||
|
Error(e.to_string())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Bindgen {
|
impl Bindgen {
|
||||||
pub fn new() -> Bindgen {
|
pub fn new() -> Bindgen {
|
||||||
Bindgen {
|
Bindgen {
|
||||||
@ -65,7 +71,7 @@ impl Bindgen {
|
|||||||
};
|
};
|
||||||
let stem = input.file_stem().unwrap().to_str().unwrap();
|
let stem = input.file_stem().unwrap().to_str().unwrap();
|
||||||
let mut module = parity_wasm::deserialize_file(input).map_err(|e| {
|
let mut module = parity_wasm::deserialize_file(input).map_err(|e| {
|
||||||
format_err!("{:?}", e)
|
Error(format!("{:?}", e))
|
||||||
})?;
|
})?;
|
||||||
let programs = extract_programs(&mut module);
|
let programs = extract_programs(&mut module);
|
||||||
|
|
||||||
@ -107,7 +113,7 @@ impl Bindgen {
|
|||||||
|
|
||||||
let wasm_path = out_dir.join(format!("{}_bg", stem)).with_extension("wasm");
|
let wasm_path = out_dir.join(format!("{}_bg", stem)).with_extension("wasm");
|
||||||
let wasm_bytes = parity_wasm::serialize(module).map_err(|e| {
|
let wasm_bytes = parity_wasm::serialize(module).map_err(|e| {
|
||||||
format_err!("{:?}", e)
|
Error(format!("{:?}", e))
|
||||||
})?;
|
})?;
|
||||||
let bytes = wasm_gc::Config::new()
|
let bytes = wasm_gc::Config::new()
|
||||||
.demangle(false)
|
.demangle(false)
|
||||||
|
@ -30,7 +30,7 @@ impl Config {
|
|||||||
pub fn generate(&mut self, wasm: &[u8]) -> Result<Output, Error> {
|
pub fn generate(&mut self, wasm: &[u8]) -> Result<Output, Error> {
|
||||||
assert!(self.base64);
|
assert!(self.base64);
|
||||||
let module = deserialize_buffer(wasm).map_err(|e| {
|
let module = deserialize_buffer(wasm).map_err(|e| {
|
||||||
format_err!("{:?}", e)
|
::Error(format!("{:?}", e))
|
||||||
})?;
|
})?;
|
||||||
Ok(Output {
|
Ok(Output {
|
||||||
module,
|
module,
|
||||||
|
Loading…
Reference in New Issue
Block a user