Skip to content

chore: bump versions 0.2.7 (#242) #1

chore: bump versions 0.2.7 (#242)

chore: bump versions 0.2.7 (#242) #1

Workflow file for this run

name: Cargo Create Docs
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-Dwarnings"
jobs:
build-rust-doc:
name: Zombienet SDK - Rust Docs
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
# TODO 24-02-08: Disable nightly due to tkaitchuck/aHash#200.
#- nightly
- stable
steps:
- uses: actions/checkout@v3
- name: Init nigthly install for fmt
run: rustup update nightly && rustup default nightly && rustup component add rustfmt
- name: Check format
run: cargo +nightly fmt --check --all
- name: Init install
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} && rustup component add clippy
- name: Create docs
run: |
cargo doc --no-deps
echo "<meta http-equiv=\"refresh\" content=\"0; url=zombienet_sdk\">" > target/doc/index.html
- name: Move docs
run: |
mkdir -p ./doc
mv ./target/doc/* ./doc
git config user.email "[email protected]"
git config user.name "GitHub Action"
git config user.password "${{ secrets.GH_PAGES_TOKEN }}"
git checkout --orphan gh-pages
mkdir to_delete
shopt -s extglob
mv !(to_delete) ./to_delete
mv ./to_delete/doc/* .
rm -rf ./to_delete
git add --all
git commit -m "Documentation"
shell: bash # Necessary for `shopt` to work
- run: git push -f origin gh-pages:gh-pages
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}