mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-25 13:01:08 +00:00
Replace cargo-web with wasm-pack on build environment
This commit is contained in:
parent
0bcf063b05
commit
affe24b9c6
7 changed files with 11 additions and 11 deletions
|
@ -168,7 +168,7 @@ jobs:
|
|||
steps:
|
||||
- restore_env:
|
||||
cache: <<#parameters.postgres>>postgres<</ parameters.postgres>><<^parameters.postgres>>sqlite<</parameters.postgres>>
|
||||
- run: cargo web deploy -p plume-front
|
||||
- run: RUSTFLAGS="--cfg=web_sys_unstable_apis" wasm-pack build --target web --release plume-front
|
||||
- run_with_coverage:
|
||||
cmd: |
|
||||
cmd="cargo install --debug --no-default-features --features="${FEATURES}",test --force --path . -j"
|
||||
|
@ -203,7 +203,7 @@ jobs:
|
|||
steps:
|
||||
- restore_env:
|
||||
cache: release-<<#parameters.postgres>>postgres<</ parameters.postgres>><<^parameters.postgres>>sqlite<</parameters.postgres>>
|
||||
- run: cargo web deploy -p plume-front --release
|
||||
- run: RUSTFLAGS="--cfg=web_sys_unstable_apis" wasm-pack build --target web --release plume-front
|
||||
- build:
|
||||
package: plume
|
||||
release: true
|
||||
|
|
|
@ -16,7 +16,7 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2021-0
|
|||
rustup component add rust-std --target wasm32-unknown-unknown
|
||||
|
||||
#compile some deps
|
||||
RUN cargo install cargo-web &&\
|
||||
RUN cargo install wasm-pack &&\
|
||||
cargo install grcov &&\
|
||||
strip /root/.cargo/bin/* &&\
|
||||
rm -fr ~/.cargo/registry
|
||||
|
|
|
@ -19,7 +19,7 @@ RUN chmod a+x ./wasm-deps.sh && sleep 1 && ./wasm-deps.sh
|
|||
|
||||
WORKDIR /app
|
||||
COPY Cargo.toml Cargo.lock rust-toolchain ./
|
||||
RUN cargo install cargo-web
|
||||
RUN cargo install wasm-pack
|
||||
|
||||
COPY . .
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ RUN chmod a+x ./wasm-deps.sh && sleep 1 && ./wasm-deps.sh
|
|||
WORKDIR /app
|
||||
COPY Cargo.toml Cargo.lock rust-toolchain ./
|
||||
RUN cargo install diesel_cli --no-default-features --features postgres --version '=1.3.0'
|
||||
RUN cargo install cargo-web
|
||||
RUN cargo install wasm-pack
|
||||
|
||||
COPY . .
|
||||
|
||||
|
|
4
script/plume-front.sh
Normal file → Executable file
4
script/plume-front.sh
Normal file → Executable file
|
@ -21,7 +21,7 @@ EOF
|
|||
if [ $ARCH == "aarch64" -o $ARCH == "armv71" ] ; then
|
||||
export PATH=/opt/local/llvm/bin:${PATH}
|
||||
cd /app
|
||||
RUSTFLAGS="-C linker=lld" cargo web deploy -p plume-front
|
||||
RUSTFLAGS="-C linker=lld --cfg=web_sys_unstable_apis" wasm-pack build --target web --release plume-front
|
||||
else
|
||||
cargo web deploy -p plume-front
|
||||
RUSTFLAGS="--cfg=web_sys_unstable_apis" wasm-pack build --target web --release plume-front
|
||||
fi
|
||||
|
|
|
@ -9,7 +9,7 @@ pkg="$4"
|
|||
build () {
|
||||
features="$1"
|
||||
cargo clean
|
||||
cargo web deploy -p plume-front --release
|
||||
RUSTFLAGS="--cfg=web_sys_unstable_apis" wasm-pack build --target web --release plume-front
|
||||
cargo build --release --no-default-features --features="${features}" --package=plume-cli
|
||||
cargo build --release --no-default-features --features="${features}"
|
||||
./script/generate_artifact.sh
|
||||
|
|
|
@ -38,17 +38,17 @@ parts:
|
|||
snapcraftctl set-version $(git describe --tags)
|
||||
export PATH=$PATH:$HOME/.cargo/bin
|
||||
rustup install stable
|
||||
cargo +stable install --force cargo-web
|
||||
cargo +stable install --force wasm-pack
|
||||
|
||||
# Only Tier 1 Rust platforms get rust-lld
|
||||
# On the others (arm64, armhf, powerpc64, s390x) fall back to using
|
||||
# the system LLD we've installed earlier.
|
||||
case ${SNAPCRAFT_ARCH_TRIPLET} in \
|
||||
aarch64-linux-gnu|arm-linux-gnueabihf|powerpc64-linux-gnu|s390x-linux-gnu) \
|
||||
RUSTFLAGS="-C linker=lld-8" cargo web deploy -p plume-front --release \
|
||||
RUSTFLAGS="-C linker=lld --cfg=web_sys_unstable_apis" wasm-pack build --target web --release plume-front \
|
||||
;; \
|
||||
*) \
|
||||
cargo web deploy -p plume-front --release \
|
||||
RUSTFLAGS="--cfg=web_sys_unstable_apis" wasm-pack build --target web --release plume-front \
|
||||
;; \
|
||||
esac
|
||||
|
||||
|
|
Loading…
Reference in a new issue