|
1 |
| -name: Build |
| 1 | +name: CI for Windows |
| 2 | +# https://github.com/google/mozc/blob/master/docs/build_mozc_in_windows.md |
2 | 3 |
|
3 |
| -on: [push] |
| 4 | +# Run on push. |
| 5 | +on: push |
4 | 6 |
|
5 | 7 | permissions: read-all
|
6 | 8 |
|
| 9 | +# Prevent previous workflows from running. |
7 | 10 | concurrency:
|
8 | 11 | group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
9 | 12 | cancel-in-progress: true
|
| 13 | + |
10 | 14 | jobs:
|
11 |
| - build_windows: |
12 |
| - runs-on: windows-latest |
| 15 | + buildutdic: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + repository: utuhiro78/merge-ut-dictionaries |
| 22 | + fetch-depth: 0 |
| 23 | + |
| 24 | + - name: setup |
| 25 | + working-directory: src/merge |
| 26 | + run: | |
| 27 | + sed -i -e 's/#generate_latest/generate_latest' make.sh |
| 28 | + chmod +x make.sh |
| 29 | +
|
| 30 | + - name: build ut dic |
| 31 | + working-directory: src/merge |
| 32 | + run: | |
| 33 | + bash make.sh |
| 34 | +
|
| 35 | + - name: Upload Artifacts |
| 36 | + uses: actions/upload-artifact@v4 |
| 37 | + with: |
| 38 | + name: utdic |
| 39 | + retention-days: 1 |
| 40 | + path: | |
| 41 | + src/merge/mozcdic-ut.txt |
| 42 | + build: |
| 43 | + # https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md |
| 44 | + runs-on: windows-2022 |
13 | 45 | timeout-minutes: 120
|
| 46 | + needs: |
| 47 | + - buildutdic |
14 | 48 |
|
15 | 49 | steps:
|
16 |
| - - name: Checkout |
17 |
| - uses: actions/checkout@v4 |
18 |
| - with: |
19 |
| - repository: google/mozc |
20 |
| - submodules: 'recursive' |
21 |
| - |
22 |
| - - name: Checkout |
23 |
| - uses: actions/checkout@v4 |
24 |
| - with: |
25 |
| - repository: stm7128/merge-ut-dictionaries-win |
26 |
| - path: merge-ut-dictionaries-win |
27 |
| - |
28 |
| - - name: Set up Ruby |
29 |
| - uses: ruby/setup-ruby@v1 |
30 |
| - with: |
31 |
| - ruby-version: ruby-head |
32 |
| - bundler-cache: true |
33 |
| - |
34 |
| - - name: make UT dic |
35 |
| - shell: cmd |
36 |
| - working-directory: .\merge-ut-dictionaries-win\src\ |
37 |
| - run: | |
38 |
| - .\make.ps1 |
39 |
| - Get-Content .\mozcdic-ut.txt >> ..\src\data\dictionary_oss\dictionary00.txt |
40 |
| - |
41 |
| - - name: Set up pip |
42 |
| - shell: cmd |
43 |
| - working-directory: .\src |
44 |
| - run: | |
45 |
| - python -m pip install six requests |
46 |
| -
|
47 |
| -
|
48 |
| - - name: Try to restore update_deps cache |
49 |
| - uses: actions/cache@v4 |
50 |
| - with: |
51 |
| - path: src/third_party_cache |
52 |
| - key: update_deps-${{ runner.os }}-${{ hashFiles('src/build_tools/update_deps.py') }} |
53 |
| - |
54 |
| - - name: Install Dependencies |
55 |
| - shell: cmd |
56 |
| - working-directory: .\src |
57 |
| - # This command uses src/third_party_cache as the download cache. |
58 |
| - run: | |
59 |
| - python build_tools/update_deps.py |
60 |
| -
|
61 |
| -
|
62 |
| - - name: Biuld Qt |
63 |
| - shell: cmd |
64 |
| - working-directory: .\src |
65 |
| - run: | |
66 |
| - python build_tools/build_qt.py --release --confirm_license |
67 |
| -
|
68 |
| - - name: Delete Qt src to save disk space |
69 |
| - shell: cmd |
70 |
| - working-directory: .\src |
71 |
| - run: | |
72 |
| - rmdir third_party\qt_src /s /q |
73 |
| -
|
74 |
| - - name: gyp |
75 |
| - shell: cmd |
76 |
| - working-directory: .\src |
77 |
| - run: | |
78 |
| - python build_mozc.py gyp |
79 |
| -
|
80 |
| - - name: build package |
81 |
| - shell: cmd |
82 |
| - working-directory: .\src |
83 |
| - run: | |
84 |
| - python build_mozc.py build -c Release package |
85 |
| -
|
86 |
| -
|
87 |
| - - name: upload Mozc64.msi |
88 |
| - uses: actions/upload-artifact@v4 |
89 |
| - with: |
90 |
| - name: Mozc64.msi |
91 |
| - path: src/out_win/Release/Mozc64.msi |
92 |
| - if-no-files-found: warn |
| 50 | + - name: Checkout |
| 51 | + uses: actions/checkout@v4 |
| 52 | + with: |
| 53 | + submodules: 'recursive' |
| 54 | + |
| 55 | + - name: Download artifact |
| 56 | + uses: actions/download-artifact@v4 |
| 57 | + with: |
| 58 | + name: utdic |
| 59 | + |
| 60 | + - name: patching utdic |
| 61 | + shell: bash |
| 62 | + run: | |
| 63 | + cat mozcdic-ut.txt >> ./src/data/dictionary_oss/dictionary00.txt |
| 64 | +
|
| 65 | + - name: Set up pip |
| 66 | + shell: cmd |
| 67 | + working-directory: .\src |
| 68 | + run: | |
| 69 | + python -m pip install six requests |
| 70 | +
|
| 71 | + - name: Try to restore update_deps cache |
| 72 | + uses: actions/cache@v4 |
| 73 | + with: |
| 74 | + path: src/third_party_cache |
| 75 | + key: update_deps-${{ runner.os }}-${{ hashFiles('src/build_tools/update_deps.py') }} |
| 76 | + |
| 77 | + - name: Install Dependencies |
| 78 | + shell: cmd |
| 79 | + working-directory: .\src |
| 80 | + # This command uses src/third_party_cache as the download cache. |
| 81 | + run: | |
| 82 | + python build_tools/update_deps.py |
93 | 83 |
|
| 84 | + - name: Build Qt |
| 85 | + shell: cmd |
| 86 | + working-directory: .\src |
| 87 | + run: | |
| 88 | + python build_tools/build_qt.py --release --confirm_license |
94 | 89 |
|
| 90 | + # This is needed only for GitHub Actions where free disk space is quite limited. |
| 91 | + - name: Delete Qt src to save disk space |
| 92 | + shell: cmd |
| 93 | + working-directory: .\src |
| 94 | + run: | |
| 95 | + rmdir third_party\qt_src /s /q |
95 | 96 |
|
| 97 | + - name: gyp |
| 98 | + shell: cmd |
| 99 | + working-directory: .\src |
| 100 | + run: | |
| 101 | + python build_mozc.py gyp |
| 102 | +
|
| 103 | + - name: build package |
| 104 | + shell: cmd |
| 105 | + working-directory: .\src |
| 106 | + run: | |
| 107 | + python build_mozc.py build -c Release package |
| 108 | +
|
| 109 | + - name: upload Mozc64.msi |
| 110 | + uses: actions/upload-artifact@v4 |
| 111 | + with: |
| 112 | + name: Mozc64.msi |
| 113 | + path: src/out_win/Release/Mozc64.msi |
| 114 | + if-no-files-found: warn |
| 115 | + |
| 116 | + # actions/cache works without this job, but having this would increase the likelihood of cache hit |
| 117 | + # in other jobs. Another approach would be to use "needs:". |
| 118 | + # https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow |
96 | 119 | cache_deps:
|
97 |
| - # https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md |
98 |
| - runs-on: windows-latest |
| 120 | + # https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md |
| 121 | + runs-on: windows-2022 |
99 | 122 | timeout-minutes: 15
|
| 123 | + |
100 | 124 | steps:
|
101 | 125 | - name: Checkout
|
102 | 126 | uses: actions/checkout@v4
|
103 |
| - with: |
104 |
| - repository: google/mozc |
105 |
| - submodules: 'recursive' |
106 | 127 |
|
107 | 128 | - name: Set up pip
|
108 | 129 | shell: cmd
|
|
0 commit comments