mirror of
https://github.com/yewprint/yewprint
synced 2024-11-22 03:23:03 +00:00
Manually deploy using GitHub Actions build (#70)
Also added API ref doc
This commit is contained in:
parent
bf9f78debe
commit
2f8cd1f358
4 changed files with 64 additions and 24 deletions
51
.github/workflows/main.yml
vendored
Normal file
51
.github/workflows/main.yml
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
name: Main Workflow
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
schedule:
|
||||
- cron: 0 0 1 * *
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: cargo test --all-features --verbose
|
||||
|
||||
site:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install wasm-pack
|
||||
run: |
|
||||
curl -sSL https://github.com/rustwasm/wasm-pack/releases/download/v0.9.1/wasm-pack-v0.9.1-x86_64-unknown-linux-musl.tar.gz \
|
||||
| tar xzO wasm-pack-v0.9.1-x86_64-unknown-linux-musl/wasm-pack \
|
||||
> $HOME/.cargo/bin/wasm-pack
|
||||
chmod +x $HOME/.cargo/bin/wasm-pack
|
||||
- run: cargo doc --verbose --all-features
|
||||
- name: Deploy doc
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./target/doc
|
||||
- name: Build (Release)
|
||||
run: "./build.sh --release"
|
||||
- name: Move doc to public/api
|
||||
run: mv ./target/doc ./public/api
|
||||
- name: Deploy to Netlify
|
||||
uses: nwtgck/actions-netlify@v1.1
|
||||
with:
|
||||
publish-dir: './public'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
deploy-message: ${{ github.event.head_commit.message }}
|
||||
production-deploy: true
|
||||
production-branch: main
|
||||
env:
|
||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||
timeout-minutes: 5
|
|
@ -1,24 +1,18 @@
|
|||
name: Rust
|
||||
name: PR Workflow
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
schedule:
|
||||
- cron: 0 0 1 * *
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
size: ${{ steps.build.outputs.size }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install wasm-pack
|
||||
|
@ -28,19 +22,24 @@ jobs:
|
|||
> $HOME/.cargo/bin/wasm-pack
|
||||
chmod +x $HOME/.cargo/bin/wasm-pack
|
||||
- run: cargo test --all-features --verbose
|
||||
- run: cargo doc --verbose --all-features
|
||||
- name: Build (Release)
|
||||
id: build
|
||||
run: "./build.sh --release && echo ::set-output name=size::`cat public/wasm_bg.wasm | wc -c`"
|
||||
- name: Deploy to Netlify
|
||||
uses: nwtgck/actions-netlify@v1.1
|
||||
with:
|
||||
publish-dir: './public'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
deploy-message: ${{ github.event.pull_request.title }}
|
||||
env:
|
||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||
timeout-minutes: 1
|
||||
|
||||
build-main:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
outputs:
|
||||
size: ${{ steps.build.outputs.size }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
|
@ -56,10 +55,7 @@ jobs:
|
|||
run: "./build.sh --release && echo ::set-output name=size::`cat public/wasm_bg.wasm | wc -c`"
|
||||
|
||||
checks:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: rustup install --profile default nightly
|
||||
|
@ -73,13 +69,9 @@ jobs:
|
|||
|
||||
report-wasm-size:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs:
|
||||
- build
|
||||
- build-main
|
||||
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
steps:
|
||||
- uses: mshick/add-pr-comment@v1
|
||||
env:
|
|
@ -1,4 +1,4 @@
|
|||
# <a href="https://yewprint.rm.rs"><img src="./yewprint-doc/src/logo.svg" height="32" /></a> <a href="https://yewprint.rm.rs">Yewprint</a> ![Rust](https://github.com/cecton/yewprint/workflows/Rust/badge.svg) [![Netlify Status](https://api.netlify.com/api/v1/badges/17f076ed-49e5-4185-921e-5c5759de2fdb/deploy-status)](https://app.netlify.com/sites/epic-poincare-f8adaa/deploys) [![Discord](https://img.shields.io/discord/701068342760570933)](https://discord.gg/NAFcwhp)
|
||||
# <a href="https://yewprint.rm.rs"><img src="./yewprint-doc/src/logo.svg" height="32" /></a> <a href="https://yewprint.rm.rs">Yewprint</a> ![Rust](https://github.com/cecton/yewprint/workflows/Rust/badge.svg) [![Netlify Status](https://api.netlify.com/api/v1/badges/17f076ed-49e5-4185-921e-5c5759de2fdb/deploy-status)](https://app.netlify.com/sites/epic-poincare-f8adaa/deploys) [![Discord](https://img.shields.io/discord/701068342760570933)](https://discord.gg/NAFcwhp) [![API Docs](https://img.shields.io/badge/docs.rs-yewprint-green)](https://yewprint.rm.rs/api/yewprint/)
|
||||
|
||||
|
||||
It's [Blueprint](https://blueprintjs.com), but for
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[build]
|
||||
publish = "public"
|
||||
command = "curl -sSL https://sh.rustup.rs | sh -s -- -q -y --profile minimal && source $HOME/.cargo/env && curl -sSL https://github.com/rustwasm/wasm-pack/releases/download/v0.9.1/wasm-pack-v0.9.1-x86_64-unknown-linux-musl.tar.gz | tar xzO wasm-pack-v0.9.1-x86_64-unknown-linux-musl/wasm-pack > $HOME/.cargo/bin/wasm-pack && chmod +x $HOME/.cargo/bin/wasm-pack && ./build.sh"
|
Loading…
Reference in a new issue