-
Notifications
You must be signed in to change notification settings - Fork 61
79 lines (68 loc) · 3.77 KB
/
package.yml
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
75
76
77
78
79
name: Build packages
on:
push:
branches:
- main
jobs:
mac_linux:
runs-on: ubuntu-latest
if: ${{ github.ref || github.ref == 'refs/heads/main' }}
steps:
- name: checkout
uses: actions/checkout@v3.5.0
- run: mkdir output
- run: chmod u+x .ci/*
- run: mkdir -p build/mac
- name: build
run: |
export SQUIRREL_VERSION=$( git ls-remote --tags --refs --sort="v:refname" https://github.com/rime/squirrel.git | grep -v '/latest$' | tail -n1 | sed 's/.*\///' )
export SQUIRREL_LINK=https://github.com/rime/squirrel/releases/download/${SQUIRREL_VERSION}/Squirrel-${SQUIRREL_VERSION}.zip
export SQUIRREL_PACKAGES="cantonese emoji CanCLID/rime-loengfan custom:set:config=default,key=installed_from,value=rime-cantonese custom:clear_schema_list custom:add:schema=jyut6ping3 custom:add:schema=cangjie5 custom:add:schema=stroke custom:add:schema=luna_pinyin lotem/rime-octagram-data lotem/rime-octagram-data@hant lotem/rime-octagram-data:customize:schema=jyut6ping3,model=hant"
export IBUS_PACKAGES=${SQUIRREL_PACKAGES}
# Download Mac installation script, Mac package and unzip
wget ${SQUIRREL_LINK}
7z e Squirrel*.zip -obuild/mac/
cat .ci/mac-install-template.sh | envsubst '${SQUIRREL_PACKAGES}' > ./build/mac/mac-install.sh
# Build archives
7z a output/mac-${GITHUB_REF_NAME}-installer.zip ./build/mac/*
# Copy default.custom.yaml and ibus-install.sh into output queue
cat .ci/ibus-install-template.sh | envsubst '${IBUS_PACKAGES}' > ./output/ibus-install.sh
cp .ci/default.custom.yaml output/
- uses: softprops/action-gh-release@v0.1.15
with:
files: output/*
if: startsWith(github.ref, 'refs/tags/')
- run: ls output
windows:
runs-on: ubuntu-latest
if: ${{ github.ref || github.ref == 'refs/heads/main' }}
steps:
- name: checkout
uses: actions/checkout@v3.5.0
- run: sudo apt-get install p7zip-full
- run: mkdir output
- run: chmod u+x .ci/*
- run: mkdir -p build/windows/data
- run: |
export WEASEL_VERSION=$( git ls-remote --tags --refs --sort="v:refname" https://github.com/rime/weasel.git | grep -v '/latest$' | tail -n1 | sed 's/.*\///' )
export WEASEL_LINK=https://github.com/rime/weasel/releases/download/${WEASEL_VERSION}/weasel-${WEASEL_VERSION}.0-installer.exe
export WEASEL_PACKAGES="cantonese emoji CanCLID/rime-loengfan custom:set:config=default,key=installed_from,value=rime-cantonese custom:clear_schema_list custom:add:schema=jyut6ping3 custom:add:schema=cangjie5 custom:add:schema=stroke custom:add:schema=luna_pinyin lotem/rime-octagram-data lotem/rime-octagram-data@hant lotem/rime-octagram-data:customize:schema=jyut6ping3,model=hant"
export SFXHEADER=7zSD.sfx
# Prepare update installation script template version number
cat .ci/windows-install-template.bat | envsubst > ./build/windows/windows-install.bat
# Download IME files (and 32-bit OpenCC)
export rime_dir=build/windows/data
curl -fsSL https://git.io/rime-install | bash -s -- ${WEASEL_PACKAGES}
# Prepare installer exe
wget -P ./build/windows ${WEASEL_LINK} --no-check-certificate
# Packing sfx installer...
wget https://github.com/tanxpyox/7z.sfx-backup/raw/master/${SFXHEADER}
7z a windows-installer.7z ./build/windows/*
cat ${SFXHEADER} .ci/config.txt windows-installer.7z > output/windows-sfx-${GITHUB_REF_NAME}-installer.exe
# Packing installer files into a separate zip
7z a output/windows-${GITHUB_REF_NAME}-installer.zip ./build/windows/*
- uses: softprops/action-gh-release@v0.1.15
with:
files: output/*
if: startsWith(github.ref, 'refs/tags/')
- run: ls output