Skip to content

🐛 fix preprocessor #65

🐛 fix preprocessor

🐛 fix preprocessor #65

Workflow file for this run

on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
bundle:
permissions:
contents: write
strategy:
max-parallel: 3
fail-fast: false
matrix:
flavor:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
cross: false
ext: tar.gz
- target: x86_64-pc-windows-msvc
os: windows-latest
cross: false
ext: zip
- target: x86_64-pc-windows-gnu
os: ubuntu-latest
cross: true
ext: zip
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
cross: true
ext: tar.gz
- target: x86_64-apple-darwin
os: macos-latest
cross: false
ext: tar.gz
- target: aarch64-apple-darwin
os: macos-latest
cross: false
ext: tar.gz
runs-on: ${{ matrix.flavor.os }}
steps:
- name: ⬇️ checkout repository
uses: actions/checkout@v4
- name: 🛠 setup cargo toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.flavor.target }}
- name: 🛠 setup cross toolchain
if: matrix.flavor.cross == true
run: cargo install cross
- name: ♻️ cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: ⚙️ cross build for ${{ matrix.flavor.target }}
if: matrix.flavor.cross == true
run: cross build --release --target ${{ matrix.flavor.target }}
- name: ⚙️ cargo build for ${{ matrix.flavor.target }}
if: matrix.flavor.cross == false
run: cargo build --release --target ${{ matrix.flavor.target }}
- name: 🧐 read manifest version
shell: bash
id: tagName
run: |
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: ⬇️ setup Just
uses: extractions/setup-just@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 📦 bundle Unix / Linux / MacOS
if: matrix.flavor.target != 'x86_64-pc-windows-msvc' && matrix.flavor.target != 'x86_64-pc-windows-gnu'
run: |
just bundle-tar "v${{ steps.tagName.outputs.version }}" "${{ matrix.flavor.target }}"
- name: 📦 bundle Windows MSVC
if: matrix.flavor.target == 'x86_64-pc-windows-msvc'
run: |
just bundle-7z "v${{ steps.tagName.outputs.version }}" "${{ matrix.flavor.target }}"
- name: 📦 bundle Windows GNU
if: matrix.flavor.target == 'x86_64-pc-windows-gnu'
run: |
just bundle-zip "v${{ steps.tagName.outputs.version }}" "${{ matrix.flavor.target }}"
- name: ↗️ upload artifact
uses: actions/upload-artifact@v4
with:
path: mdbook-codeblocks-v${{ steps.tagName.outputs.version }}-${{ matrix.flavor.target }}.${{ matrix.flavor.ext }}
name: artifact-mdbook-codeblocks-${{ matrix.flavor.target }}
if-no-files-found: error
release:
needs: [bundle]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: ⬇️ checkout repository
uses: actions/checkout@v4
- name: 🛠 setup cargo toolchain
uses: dtolnay/rust-toolchain@stable
- name: ♻️ cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: ↙️ download artifacts
uses: actions/download-artifact@v4
with:
path: artifact
merge-multiple: true
- name: 🧐 read manifest version
shell: bash
id: tagName
run: |
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: 🔖 create GitHub release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "artifact/*.tar.gz,artifact/*.zip"
draft: true
artifactErrorsFailBuild: true
- name: 🦀 publish to crates.io
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}