Bump to 0.3.2 (#34) #37
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
name: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build-artifacts: | |
strategy: | |
matrix: | |
include: | |
# x86 | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
kind: full | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
kind: bare | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
kind: bare | |
## TODO: Windows needs specific configuration to find | |
## NPM globally installed binaries, and I couldn't figure | |
## it out in ~30 minutes. Deal with this later. | |
# - os: windows-latest | |
# target: x86_64-pc-windows-msvc | |
# ARM | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
kind: bare | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
kind: bare | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup | |
uses: ./.github/workflows/setup | |
with: | |
target: ${{ matrix.target }} | |
- name: Build Rust package | |
run: cargo build -p mdbook-quiz --release --locked ${{ matrix.kind == 'full' && '--features rust-editor --features aquascope' || '' }} | |
- name: Package artifact | |
run: tar -czf mdbook-quiz_${{ matrix.target }}_${{ matrix.kind }}.tar.gz mdbook-quiz | |
working-directory: target/release | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ matrix.target }}_${{ matrix.kind }} | |
path: target/release/mdbook-quiz_${{ matrix.target }}_${{ matrix.kind }}.tar.gz | |
build-schema: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup | |
uses: ./.github/workflows/setup | |
- name: Build schema | |
run: cargo run --bin gen-json-schema --features json-schema > mdbook-quiz.schema.json | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: schema | |
path: mdbook-quiz.schema.json | |
publish-artifacts: | |
needs: [build-artifacts, build-schema] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v2 | |
- uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
x86_64-unknown-linux-gnu_full/mdbook-quiz_x86_64-unknown-linux-gnu_full.tar.gz | |
x86_64-unknown-linux-gnu_bare/mdbook-quiz_x86_64-unknown-linux-gnu_bare.tar.gz | |
x86_64-apple-darwin_bare/mdbook-quiz_x86_64-apple-darwin_bare.tar.gz | |
aarch64-unknown-linux-gnu_bare/mdbook-quiz_aarch64-unknown-linux-gnu_bare.tar.gz | |
aarch64-apple-darwin_bare/mdbook-quiz_aarch64-apple-darwin_bare.tar.gz | |
schema/mdbook-quiz.schema.json | |
publish-crate: | |
needs: publish-artifacts | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup | |
uses: ./.github/workflows/setup | |
- name: Install cargo-workspaces | |
uses: baptiste0928/cargo-install@v2 | |
with: | |
crate: cargo-workspaces | |
- name: Cargo release | |
run: cargo workspaces publish --from-git --yes --allow-dirty --token ${{ secrets.CARGO_TOKEN }} | |
- uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
package: ./js/packages/quiz/package.json | |
- name: Install mdbook | |
run: | | |
mkdir bin | |
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin | |
echo "$(pwd)/bin" >> ${GITHUB_PATH} | |
- name: Install mdbook-quiz | |
run: cargo install --path crates/mdbook-quiz --debug --locked | |
- name: Build example mdbook | |
run: mdbook build | |
working-directory: example | |
- name: Deploy to Github Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./example/book | |