diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 189fdcde..26d35207 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,18 +1,12 @@ name: CI -# on: -# push: -# branches: [master] -# pull_request: -# branches: [master] -# concurrency: -# group: ${{ github.workflow }}-${{ github.ref }} -# cancel-in-progress: true - on: - workflow_run: - workflows: ["release-minor-trigger"] - types: - - completed + push: + branches: [master] + pull_request: + branches: [master] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: build: diff --git a/.github/workflows/release-minor.yml b/.github/workflows/release-minor.yml index e6fed26c..59be40c9 100644 --- a/.github/workflows/release-minor.yml +++ b/.github/workflows/release-minor.yml @@ -15,7 +15,11 @@ jobs: runs-on: ubuntu-latest 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 uses: nuget/setup-nuget@v1 with: @@ -51,3 +55,22 @@ jobs: - 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 + + # 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 + \ No newline at end of file diff --git a/.github/workflows/release-patch.yml b/.github/workflows/release-patch.yml index 561a61ea..f3533b95 100644 --- a/.github/workflows/release-patch.yml +++ b/.github/workflows/release-patch.yml @@ -1,22 +1,17 @@ name: auto-patch-release -# on: -# workflow_run: -# workflows: ["release-patch-trigger"] -# types: -# - completed - on: - push: - branches: - - 'doc_ci' + workflow_run: + workflows: ["release-patch-trigger"] + types: + - completed env: NUGET_API_TOKEN: ${{ secrets.LLAMA_SHARP_NUGET_KEY }} jobs: patch_release_to_nuget: - # if: ${{ github.event.workflow_run.conclusion == 'success' }} + if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest steps: @@ -58,9 +53,10 @@ jobs: name: "drop-ci-packages" path: './temp' - # - 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 + - 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 + # Deploy the documentation to GitHub Pages - uses: actions/setup-python@v5 with: python-version: 3.x @@ -74,7 +70,7 @@ jobs: - 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 | sed 's/.$/2/') + version=$(cat ./temp/version.txt) mike deploy --push --update-aliases --force $version latest mike set-default --push --force latest