mirror of
https://github.com/rust-lang/mdBook.git
synced 2025-12-27 07:54:20 -05:00
This sets up the publish workflow to use the new OIDC authentication, and to publish the whole workspace at once.
68 lines
1.9 KiB
YAML
68 lines
1.9 KiB
YAML
name: Deploy
|
|
on:
|
|
release:
|
|
types: [created]
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- target: aarch64-unknown-linux-musl
|
|
os: ubuntu-22.04
|
|
- target: x86_64-unknown-linux-gnu
|
|
os: ubuntu-22.04
|
|
- target: x86_64-unknown-linux-musl
|
|
os: ubuntu-22.04
|
|
- target: x86_64-apple-darwin
|
|
os: macos-latest
|
|
- target: aarch64-apple-darwin
|
|
os: macos-latest
|
|
- target: x86_64-pc-windows-msvc
|
|
os: windows-latest
|
|
name: Deploy ${{ matrix.target }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install Rust
|
|
run: ci/install-rust.sh stable ${{ matrix.target }}
|
|
- name: Build asset
|
|
run: ci/make-release-asset.sh ${{ matrix.os }} ${{ matrix.target }}
|
|
- name: Update release with new asset
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: gh release upload $MDBOOK_TAG $MDBOOK_ASSET
|
|
pages:
|
|
name: GitHub Pages
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install Rust (rustup)
|
|
run: rustup update stable --no-self-update && rustup default stable
|
|
- name: Deploy the User Guide to GitHub Pages using the gh-pages branch
|
|
run: ci/publish-guide.sh
|
|
publish:
|
|
name: Publish to crates.io
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
# Required for OIDC token exchange
|
|
id-token: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install Rust (rustup)
|
|
run: rustup update stable --no-self-update && rustup default stable
|
|
- name: Authenticate with crates.io
|
|
id: auth
|
|
uses: rust-lang/crates-io-auth-action@v1
|
|
- name: Publish
|
|
env:
|
|
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
|
|
run: cargo publish --workspace --no-verify
|