Browse Source

Merge pull request #24 from AsakusaRinne/doc_ci

ci: initialize ci for doc deployment.
tags/0.11.0
Rinne GitHub 1 year ago
parent
commit
976f7fc901
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
4 changed files with 105 additions and 57 deletions
  1. +3
    -0
      .github/prepare_release.sh
  2. +55
    -55
      .github/workflows/main.yml
  3. +24
    -1
      .github/workflows/release-minor.yml
  4. +23
    -1
      .github/workflows/release-patch.yml

+ 3
- 0
.github/prepare_release.sh View File

@@ -77,5 +77,8 @@ do
nuget pack $nuspec -version $updated_version
done

# write the version to the file
echo $updated_version > version.txt

cd ..
exit 0

+ 55
- 55
.github/workflows/main.yml View File

@@ -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

+ 24
- 1
.github/workflows/release-minor.yml View File

@@ -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

+ 23
- 1
.github/workflows/release-patch.yml View File

@@ -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:
@@ -52,3 +56,21 @@ 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


Loading…
Cancel
Save