Link archived documentation from README. #463
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Continuous Integration | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: ["main"] | |
| tags: ["*.*.*"] | |
| pull_request: | |
| branches: ["main"] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: 🧰 Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: 🧰 Install Aiken | |
| uses: aiken-lang/setup-aiken@v1 | |
| with: | |
| version: v1.1.19 | |
| - name: 📝 Run fmt | |
| run: aiken fmt --check | |
| - name: 🔬 Run tests | |
| run: aiken check | |
| docs: | |
| strategy: | |
| matrix: | |
| include: | |
| - stdlib_version: v1.9.0 | |
| legacy_aiken_setup: true | |
| aiken_version: v1.0.29-alpha | |
| runner: ubuntu-22.04 | |
| - stdlib_version: v2.0.0 | |
| legacy_aiken_setup: true | |
| aiken_version: v1.1.2 | |
| - stdlib_version: v2.1.0 | |
| - stdlib_version: v2.2.0 | |
| - stdlib_version: "" | |
| runs-on: ${{ matrix.runner || 'ubuntu-latest' }} | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ matrix.stdlib_version }} | |
| - name: 🧰 Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: 🧰 Install Aiken (legacy) | |
| if: ${{ matrix.legacy_aiken_setup }} | |
| uses: aiken-lang/[email protected] | |
| with: | |
| version: ${{ matrix.aiken_version || 'v1.1.19' }} | |
| - name: 🧰 Install Aiken | |
| if: ${{ !matrix.legacy_aiken_setup }} | |
| uses: aiken-lang/setup-aiken@v1 | |
| with: | |
| version: ${{ matrix.aiken_version || 'v1.1.19' }} | |
| - name: 📘 Generate documentation | |
| shell: bash | |
| working-directory: . | |
| run: aiken docs -o docs/${{ matrix.stdlib_version || 'latest' }} | |
| - name: 🏠 Redirection page for v-less sub-directories | |
| if: ${{ matrix.stdlib_version }} | |
| shell: bash | |
| working-directory: docs | |
| run: | | |
| version=$(echo ${{matrix.stdlib_version}} | cut -c2-) | |
| mkdir -p $version | |
| cat > $version/index.html <<HTML | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Aiken StdLib API reference</title> | |
| <link rel="canonical" href="https://aiken-lang.github.io/stdlib"/> | |
| <meta name="robots" content="noindex"> | |
| <meta http-equiv="content-type" content="text/html; charset=utf-8"/> | |
| <meta http-equiv="refresh" content="0; url=/stdlib/${{ matrix.stdlib_version }}"/> | |
| </head> | |
| </html> | |
| HTML | |
| - name: 📦 Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: aiken-docs-${{ matrix.stdlib_version || 'latest' }} | |
| path: docs | |
| retention-days: 1 | |
| bundle-docs: | |
| runs-on: ubuntu-latest | |
| needs: [docs] | |
| steps: | |
| - name: 📥 Download all doc artifacts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| pattern: aiken-docs-* | |
| merge-multiple: true | |
| - name: 🏠 Landing page | |
| shell: bash | |
| run: | | |
| cat > index.html <<HTML | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Aiken StdLib API reference</title> | |
| <link rel="canonical" href="https://aiken-lang.github.io/stdlib"/> | |
| <meta name="robots" content="noindex"> | |
| <meta http-equiv="content-type" content="text/html; charset=utf-8"/> | |
| <meta http-equiv="refresh" content="0; url=/stdlib/latest"/> | |
| </head> | |
| </html> | |
| HTML | |
| - name: 📦 Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: . | |
| deploy-docs: | |
| needs: [bundle-docs] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: 🚀 Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |