Skip to content

Commit 976f7fc

Browse files
authored
Merge pull request #24 from AsakusaRinne/doc_ci
ci: initialize ci for doc deployment.
2 parents 05c8f20 + 55648a6 commit 976f7fc

File tree

4 files changed

+105
-57
lines changed

4 files changed

+105
-57
lines changed

.github/prepare_release.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,8 @@ do
7777
nuget pack $nuspec -version $updated_version
7878
done
7979

80+
# write the version to the file
81+
echo $updated_version > version.txt
82+
8083
cd ..
8184
exit 0

.github/workflows/main.yml

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
1-
# name: CI
2-
# on:
3-
# push:
4-
# branches: [master]
5-
# pull_request:
6-
# branches: [master]
7-
# concurrency:
8-
# group: ${{ github.workflow }}-${{ github.ref }}
9-
# cancel-in-progress: true
1+
name: CI
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
6+
branches: [master]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
1010

11-
# jobs:
12-
# build:
13-
# name: Test
14-
# runs-on: ${{ matrix.os }}
15-
# strategy:
16-
# max-parallel: 2
17-
# fail-fast: false
18-
# matrix:
19-
# build: [linux-release, windows-release, osx-release]
20-
# include:
21-
# - build: linux-release
22-
# os: ubuntu-latest
23-
# config: release
24-
# - build: osx-release
25-
# os: macos-latest
26-
# config: release
27-
# - build: windows-release
28-
# os: windows-2019
29-
# config: release
30-
# steps:
31-
# - uses: actions/checkout@v4
32-
# - uses: actions/setup-dotnet@v4
33-
# with:
34-
# dotnet-version: |
35-
# 7.0.x
36-
# 8.0.x
37-
# - name: Cache Packages
38-
# uses: actions/cache@v4
39-
# with:
40-
# key: "unit_test_models"
41-
# path: LLama.Unittest/Models
42-
# # workaround for actions/setup-dotnet#155
43-
# - name: Clear package cache
44-
# run: dotnet clean LLamaSharp.sln && dotnet nuget locals all --clear
45-
# - name: Restore packages
46-
# run: dotnet restore LLamaSharp.sln
47-
# - name: Build
48-
# run: dotnet build LLamaSharp.sln -c ${{ matrix.config }} --no-restore
49-
# - name: Test
50-
# run: dotnet test LLamaSharp.sln -c ${{ matrix.config }} -l "console;verbosity=detailed" --diag:logs/log.txt
51-
# - name: Upload artifacts
52-
# if: always()
53-
# uses: actions/upload-artifact@v3
54-
# with:
55-
# path: logs/
56-
# name: logs
11+
jobs:
12+
build:
13+
name: Test
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
max-parallel: 2
17+
fail-fast: false
18+
matrix:
19+
build: [linux-release, windows-release, osx-release]
20+
include:
21+
- build: linux-release
22+
os: ubuntu-latest
23+
config: release
24+
- build: osx-release
25+
os: macos-latest
26+
config: release
27+
- build: windows-release
28+
os: windows-2019
29+
config: release
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: |
35+
7.0.x
36+
8.0.x
37+
- name: Cache Packages
38+
uses: actions/cache@v4
39+
with:
40+
key: "unit_test_models"
41+
path: LLama.Unittest/Models
42+
# workaround for actions/setup-dotnet#155
43+
- name: Clear package cache
44+
run: dotnet clean LLamaSharp.sln && dotnet nuget locals all --clear
45+
- name: Restore packages
46+
run: dotnet restore LLamaSharp.sln
47+
- name: Build
48+
run: dotnet build LLamaSharp.sln -c ${{ matrix.config }} --no-restore
49+
- name: Test
50+
run: dotnet test LLamaSharp.sln -c ${{ matrix.config }} -l "console;verbosity=detailed" --diag:logs/log.txt
51+
- name: Upload artifacts
52+
if: always()
53+
uses: actions/upload-artifact@v3
54+
with:
55+
path: logs/
56+
name: logs

.github/workflows/release-minor.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
19+
- name: Configure Git Credentials
20+
run: |
21+
git config user.name Rinne
22+
git config user.email [email protected]
1923
- name: Setup NuGet
2024
uses: nuget/setup-nuget@v1
2125
with:
@@ -51,3 +55,22 @@ jobs:
5155

5256
- name: Push LLamaSharp packages to nuget.org
5357
run: dotnet nuget push ./temp/LLamaSharp*.nupkg --source https://www.nuget.org -k ${{ secrets.LLAMA_SHARP_NUGET_KEY }} --skip-duplicate
58+
59+
# Deploy the documentation to GitHub Pages
60+
- uses: actions/setup-python@v5
61+
with:
62+
python-version: 3.x
63+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
64+
- uses: actions/cache@v4
65+
with:
66+
key: mkdocs-material-${{ env.cache_id }}
67+
path: .cache
68+
restore-keys: |
69+
mkdocs-material-
70+
- run: pip install mkdocs==1.4.3 mkdocs-material mike==1.1.2 setuptools
71+
- run: |
72+
git fetch origin gh-pages --depth=1
73+
version=$(cat ./temp/version.txt)
74+
mike deploy --push --update-aliases --force $version latest
75+
mike set-default --push --force latest
76+

.github/workflows/release-patch.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
19+
- name: Configure Git Credentials
20+
run: |
21+
git config user.name Rinne
22+
git config user.email [email protected]
1923
- name: Setup NuGet
2024
uses: nuget/setup-nuget@v1
2125
with:
@@ -52,3 +56,21 @@ jobs:
5256
- name: Push LLamaSharp packages to nuget.org
5357
run: dotnet nuget push ./temp/LLamaSharp*.nupkg --source https://www.nuget.org -k ${{ secrets.LLAMA_SHARP_NUGET_KEY }} --skip-duplicate
5458

59+
# Deploy the documentation to GitHub Pages
60+
- uses: actions/setup-python@v5
61+
with:
62+
python-version: 3.x
63+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
64+
- uses: actions/cache@v4
65+
with:
66+
key: mkdocs-material-${{ env.cache_id }}
67+
path: .cache
68+
restore-keys: |
69+
mkdocs-material-
70+
- run: pip install mkdocs==1.4.3 mkdocs-material mike==1.1.2 setuptools
71+
- run: |
72+
git fetch origin gh-pages --depth=1
73+
version=$(cat ./temp/version.txt)
74+
mike deploy --push --update-aliases --force $version latest
75+
mike set-default --push --force latest
76+

0 commit comments

Comments
 (0)