Skip to content

Bump to 0.3.0

Bump to 0.3.0 #34

Workflow file for this run

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
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
profile: minimal
override: true
- name: Install cargo-make
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-make
- name: Install Depot
run: |
curl https://raw.githubusercontent.com/cognitive-engineering-lab/depot/main/scripts/install.sh | sh
echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
- name: Initialize TS bindings
run: cargo make init-bindings
- 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
publish-artifacts:
needs: build-artifacts
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
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