From a47b4369f8d7a9dd5068c3203a25162b95c45335 Mon Sep 17 00:00:00 2001 From: Anthony Oteri Date: Fri, 29 Sep 2023 11:58:24 -0400 Subject: [PATCH] Add task to build documentation --- .github/workflows/release.yml | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cca1595..a58fa33 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,50 @@ jobs: draft: false prerelease: false + build-docs: + name: Build documentation + needs: create_release + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust Toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + components: rustdoc + + - name: Cache build dependencies + uses: Swatinem/rust-cache@v2 + + - name: Run cargo doc + run: + cargo doc + --bin=dredge + --no-deps + --all-features + --document-private-items + --release + + - name: Archive the Docs + run: + tar --directory target/doc -czf + dredge-$(( github.ref_name))-docs.tar.gz + dredge + + - name: Upload documentation assets + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create_release.outputs.upload_url }} + asset_name: dredge-${{ github.ref_name }}-docs.tar.gz + asset_path: dredge-${{ github.ref_name }}-docs.tar.gz + asset_content_type: application/gzip + release_assets: name: Release assets needs: create_release