diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 13d7132149..1ce47d5660 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,13 +12,13 @@ defaults: run: shell: bash +env: + RUSTFLAGS: --deny warnings + jobs: lint: runs-on: ubuntu-latest - env: - RUSTFLAGS: --deny warnings - steps: - uses: actions/checkout@v4 @@ -43,11 +43,6 @@ jobs: pages: runs-on: ubuntu-latest - permissions: - contents: write - - env: - RUSTFLAGS: --deny warnings steps: - uses: actions/checkout@v4 @@ -72,14 +67,6 @@ jobs: mdbook build book/en mdbook build book/zh - - name: Deploy Pages - uses: peaceiris/actions-gh-pages@v4 - if: github.ref == 'refs/heads/master' - with: - github_token: ${{secrets.GITHUB_TOKEN}} - publish_branch: gh-pages - publish_dir: www - test: strategy: matrix: @@ -90,9 +77,6 @@ jobs: runs-on: ${{matrix.os}} - env: - RUSTFLAGS: --deny warnings - steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 323f6f009f..72c63a90f9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,6 +9,9 @@ defaults: run: shell: bash +env: + RUSTFLAGS: --deny warnings + jobs: prerelease: runs-on: ubuntu-latest @@ -164,3 +167,43 @@ jobs: prerelease: ${{ needs.prerelease.outputs.value }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + pages: + runs-on: ubuntu-latest + + needs: + - prerelease + + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + + - uses: Swatinem/rust-cache@v2 + + - name: Install `mdbook` + run: cargo install mdbook + + - name: Install `mdbook-linkcheck` + run: | + mkdir -p mdbook-linkcheck + cd mdbook-linkcheck + wget https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip + unzip mdbook-linkcheck.x86_64-unknown-linux-gnu.zip + chmod +x mdbook-linkcheck + pwd >> $GITHUB_PATH + + - name: Build book + run: | + cargo run --package generate-book + mdbook build book/en + mdbook build book/zh + + - name: Deploy Pages + uses: peaceiris/actions-gh-pages@v4 + if: ${{ needs.prerelease.outputs.value }} + with: + github_token: ${{secrets.GITHUB_TOKEN}} + publish_branch: gh-pages + publish_dir: www diff --git a/README.md b/README.md index 1c626eef31..fa197cac94 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,10 @@ `just` is a handy way to save and run project-specific commands. -This readme is also available as a [book](https://just.systems/man/en/). +This readme is also available as a [book](https://just.systems/man/en/). The +book reflects the latest release, whereas the +[readme on GitHub](https://github.com/casey/just/blob/master/README.md) +reflects latest master. (中文文档在 [这里](https://github.com/casey/just/blob/master/README.中文.md), 快看过来!)