Skip to content

Bump to 0.2.16

Bump to 0.2.16 #33

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
- os: macos-latest
target: x86_64-apple-darwin
## 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
- os: macos-latest
target: aarch64-apple-darwin
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
- name: Package artifact
run: tar -czf mdbook-quiz-${{ matrix.target }}.tar.gz mdbook-quiz
working-directory: target/release
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.target }}
path: target/release/mdbook-quiz-${{ matrix.target }}.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/mdbook-quiz-x86_64-unknown-linux-gnu.tar.gz
x86_64-apple-darwin/mdbook-quiz-x86_64-apple-darwin.tar.gz
aarch64-unknown-linux-gnu/mdbook-quiz-aarch64-unknown-linux-gnu.tar.gz
aarch64-apple-darwin/mdbook-quiz-aarch64-apple-darwin.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