-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (62 loc) · 2.23 KB
/
Copy pathconverter.yml
File metadata and controls
75 lines (62 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build and run the converter
on:
workflow_call:
outputs:
chm_name:
description: The folder name representing the chm file name
value: ${{ jobs.build_and_run.outputs.chm_name }}
inputs:
run_tests:
type: boolean
is_index:
type: boolean
is_optimizing:
type: boolean
upload_converted:
type: boolean
jobs:
build_and_run:
outputs:
chm_name: ${{ case(inputs.is_index, '', steps.get_chm_name.outputs.result) }}
env:
build_config: Release
book_folder: ${{ github.event.repository.name }}${{ case(inputs.is_index, '/index', '') }}
runs-on: ubuntu-latest
steps:
- name: Set $build_config_lower
run: echo "build_config_lower=${build_config@L}" >> "$GITHUB_ENV"
- name: Checkout Book
if: ${{ !inputs.is_index }}
uses: actions/checkout@v6
with:
path: ${{ env.book_folder }}
- name: Get the folder name representing the chm file name
id: get_chm_name
if: ${{ !inputs.is_index }}
run: echo "result=$(ls ${{ env.book_folder }}/en)" >> "$GITHUB_OUTPUT"
- name: Checkout Index with Converter
uses: actions/checkout@v6
with:
repository: originlab/originlab.github.io
path: originlab.github.io
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'
#- run: ls -l -R
- name: Build the converter
run: dotnet build -c $build_config originlab.github.io/converter/generator/generator.csproj
- name: Test the converter
if: ${{ inputs.run_tests }}
run: dotnet run -c $build_config --project originlab.github.io/converter/tests/tests.csproj
- name: Run the Converter
run: |
dotnet "originlab.github.io/artifacts/bin/generator/$build_config_lower/generator.dll" "$book_folder" \
${{ case(inputs.is_index, '--merge', '') }} \
${{ case(inputs.is_optimizing, '--webp', '') }}
- name: Upload converted artifact
if: ${{ inputs.upload_converted }}
uses: actions/upload-artifact@v7
with:
name: converted
path: originlab.github.io/artifacts/public_html
retention-days: 1