ci: initialize ci for doc deployment.tags/0.11.0
| @@ -77,5 +77,8 @@ do | |||||
| nuget pack $nuspec -version $updated_version | nuget pack $nuspec -version $updated_version | ||||
| done | done | ||||
| # write the version to the file | |||||
| echo $updated_version > version.txt | |||||
| cd .. | cd .. | ||||
| exit 0 | exit 0 | ||||
| @@ -1,56 +1,56 @@ | |||||
| # name: CI | |||||
| # on: | |||||
| # push: | |||||
| # branches: [master] | |||||
| # pull_request: | |||||
| # branches: [master] | |||||
| # concurrency: | |||||
| # group: ${{ github.workflow }}-${{ github.ref }} | |||||
| # cancel-in-progress: true | |||||
| name: CI | |||||
| on: | |||||
| push: | |||||
| branches: [master] | |||||
| pull_request: | |||||
| branches: [master] | |||||
| concurrency: | |||||
| group: ${{ github.workflow }}-${{ github.ref }} | |||||
| cancel-in-progress: true | |||||
| # jobs: | |||||
| # build: | |||||
| # name: Test | |||||
| # runs-on: ${{ matrix.os }} | |||||
| # strategy: | |||||
| # max-parallel: 2 | |||||
| # fail-fast: false | |||||
| # matrix: | |||||
| # build: [linux-release, windows-release, osx-release] | |||||
| # include: | |||||
| # - build: linux-release | |||||
| # os: ubuntu-latest | |||||
| # config: release | |||||
| # - build: osx-release | |||||
| # os: macos-latest | |||||
| # config: release | |||||
| # - build: windows-release | |||||
| # os: windows-2019 | |||||
| # config: release | |||||
| # steps: | |||||
| # - uses: actions/checkout@v4 | |||||
| # - uses: actions/setup-dotnet@v4 | |||||
| # with: | |||||
| # dotnet-version: | | |||||
| # 7.0.x | |||||
| # 8.0.x | |||||
| # - name: Cache Packages | |||||
| # uses: actions/cache@v4 | |||||
| # with: | |||||
| # key: "unit_test_models" | |||||
| # path: LLama.Unittest/Models | |||||
| # # workaround for actions/setup-dotnet#155 | |||||
| # - name: Clear package cache | |||||
| # run: dotnet clean LLamaSharp.sln && dotnet nuget locals all --clear | |||||
| # - name: Restore packages | |||||
| # run: dotnet restore LLamaSharp.sln | |||||
| # - name: Build | |||||
| # run: dotnet build LLamaSharp.sln -c ${{ matrix.config }} --no-restore | |||||
| # - name: Test | |||||
| # run: dotnet test LLamaSharp.sln -c ${{ matrix.config }} -l "console;verbosity=detailed" --diag:logs/log.txt | |||||
| # - name: Upload artifacts | |||||
| # if: always() | |||||
| # uses: actions/upload-artifact@v3 | |||||
| # with: | |||||
| # path: logs/ | |||||
| # name: logs | |||||
| jobs: | |||||
| build: | |||||
| name: Test | |||||
| runs-on: ${{ matrix.os }} | |||||
| strategy: | |||||
| max-parallel: 2 | |||||
| fail-fast: false | |||||
| matrix: | |||||
| build: [linux-release, windows-release, osx-release] | |||||
| include: | |||||
| - build: linux-release | |||||
| os: ubuntu-latest | |||||
| config: release | |||||
| - build: osx-release | |||||
| os: macos-latest | |||||
| config: release | |||||
| - build: windows-release | |||||
| os: windows-2019 | |||||
| config: release | |||||
| steps: | |||||
| - uses: actions/checkout@v4 | |||||
| - uses: actions/setup-dotnet@v4 | |||||
| with: | |||||
| dotnet-version: | | |||||
| 7.0.x | |||||
| 8.0.x | |||||
| - name: Cache Packages | |||||
| uses: actions/cache@v4 | |||||
| with: | |||||
| key: "unit_test_models" | |||||
| path: LLama.Unittest/Models | |||||
| # workaround for actions/setup-dotnet#155 | |||||
| - name: Clear package cache | |||||
| run: dotnet clean LLamaSharp.sln && dotnet nuget locals all --clear | |||||
| - name: Restore packages | |||||
| run: dotnet restore LLamaSharp.sln | |||||
| - name: Build | |||||
| run: dotnet build LLamaSharp.sln -c ${{ matrix.config }} --no-restore | |||||
| - name: Test | |||||
| run: dotnet test LLamaSharp.sln -c ${{ matrix.config }} -l "console;verbosity=detailed" --diag:logs/log.txt | |||||
| - name: Upload artifacts | |||||
| if: always() | |||||
| uses: actions/upload-artifact@v3 | |||||
| with: | |||||
| path: logs/ | |||||
| name: logs | |||||
| @@ -15,7 +15,11 @@ jobs: | |||||
| runs-on: ubuntu-latest | runs-on: ubuntu-latest | ||||
| steps: | steps: | ||||
| - uses: actions/checkout@v3 | |||||
| - uses: actions/checkout@v4 | |||||
| - name: Configure Git Credentials | |||||
| run: | | |||||
| git config user.name Rinne | |||||
| git config user.email AsakusaRinne@gmail.com | |||||
| - name: Setup NuGet | - name: Setup NuGet | ||||
| uses: nuget/setup-nuget@v1 | uses: nuget/setup-nuget@v1 | ||||
| with: | with: | ||||
| @@ -51,3 +55,22 @@ jobs: | |||||
| - name: Push LLamaSharp packages to nuget.org | - name: Push LLamaSharp packages to nuget.org | ||||
| run: dotnet nuget push ./temp/LLamaSharp*.nupkg --source https://www.nuget.org -k ${{ secrets.LLAMA_SHARP_NUGET_KEY }} --skip-duplicate | run: dotnet nuget push ./temp/LLamaSharp*.nupkg --source https://www.nuget.org -k ${{ secrets.LLAMA_SHARP_NUGET_KEY }} --skip-duplicate | ||||
| # Deploy the documentation to GitHub Pages | |||||
| - uses: actions/setup-python@v5 | |||||
| with: | |||||
| python-version: 3.x | |||||
| - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |||||
| - uses: actions/cache@v4 | |||||
| with: | |||||
| key: mkdocs-material-${{ env.cache_id }} | |||||
| path: .cache | |||||
| restore-keys: | | |||||
| mkdocs-material- | |||||
| - run: pip install mkdocs==1.4.3 mkdocs-material mike==1.1.2 setuptools | |||||
| - run: | | |||||
| git fetch origin gh-pages --depth=1 | |||||
| version=$(cat ./temp/version.txt) | |||||
| mike deploy --push --update-aliases --force $version latest | |||||
| mike set-default --push --force latest | |||||
| @@ -15,7 +15,11 @@ jobs: | |||||
| runs-on: ubuntu-latest | runs-on: ubuntu-latest | ||||
| steps: | steps: | ||||
| - uses: actions/checkout@v3 | |||||
| - uses: actions/checkout@v4 | |||||
| - name: Configure Git Credentials | |||||
| run: | | |||||
| git config user.name Rinne | |||||
| git config user.email AsakusaRinne@gmail.com | |||||
| - name: Setup NuGet | - name: Setup NuGet | ||||
| uses: nuget/setup-nuget@v1 | uses: nuget/setup-nuget@v1 | ||||
| with: | with: | ||||
| @@ -52,3 +56,21 @@ jobs: | |||||
| - name: Push LLamaSharp packages to nuget.org | - name: Push LLamaSharp packages to nuget.org | ||||
| run: dotnet nuget push ./temp/LLamaSharp*.nupkg --source https://www.nuget.org -k ${{ secrets.LLAMA_SHARP_NUGET_KEY }} --skip-duplicate | run: dotnet nuget push ./temp/LLamaSharp*.nupkg --source https://www.nuget.org -k ${{ secrets.LLAMA_SHARP_NUGET_KEY }} --skip-duplicate | ||||
| # Deploy the documentation to GitHub Pages | |||||
| - uses: actions/setup-python@v5 | |||||
| with: | |||||
| python-version: 3.x | |||||
| - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |||||
| - uses: actions/cache@v4 | |||||
| with: | |||||
| key: mkdocs-material-${{ env.cache_id }} | |||||
| path: .cache | |||||
| restore-keys: | | |||||
| mkdocs-material- | |||||
| - run: pip install mkdocs==1.4.3 mkdocs-material mike==1.1.2 setuptools | |||||
| - run: | | |||||
| git fetch origin gh-pages --depth=1 | |||||
| version=$(cat ./temp/version.txt) | |||||
| mike deploy --push --update-aliases --force $version latest | |||||
| mike set-default --push --force latest | |||||