-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (158 loc) · 6.87 KB
/
release-win.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Build and release for Windows
on:
push:
branches:
- main
jobs:
check_version:
uses: ./.github/workflows/check-version-tag.yml
fetch:
needs: [check_version]
if: ${{ needs.check_version.outputs.should_run != 'false' }}
runs-on: windows-2019-beefy
name: Fetch external projects
steps:
- name: Turn off line ending conversion in git
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Sparse Checkout
run: |
git clone --no-checkout --depth=1 --filter=blob:none --sparse --branch=${{ github.ref_name }} --single-branch https://github.com/${{ github.repository }} lok
cd lok
git config --local gc.auto 0
tee .git/info/sparse-checkout <<EOF
/*
!/*/
/libreoffice-core/
!/libreoffice-core/translations
!/libreoffice-core/helpcontent2
/libreoffice-core/dictionaries
!/libreoffice-core/dictionaries/*/
/libreoffice-core/dictionaries/en
/libreoffice-core/translations/source
!/libreoffice-core/translations/source/*/
/libreoffice-core/translations/source/en-GB/
/libreoffice-core/translations/source/en-ZA/
EOF
git -c protocol.version=2 checkout
shell: bash
- name: Speed up cache restore on Windows
if: steps.cache-external-tar.outputs.cache-hit != 'true'
shell: cmd
run: |
echo "Adding GNU tar to PATH"
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
- name: Cache external tarballs
id: cache-external-tar
uses: actions/cache@v3
with:
path: C:\external-tar
key: external-tar-${{ hashFiles('lok/libreoffice-core/download.lst') }}-${{ hashFiles('lok/libreoffice-core/external/**/*') }}
restore-keys: |
external-tar--${{ hashFiles('lok/libreoffice-core/external/**/*') }}
external-tar--
external-tar-
- name: Install Cygwin
if: steps.cache-external-tar.outputs.cache-hit != 'true'
run: |
curl -LO https://github.com/coparse-inc/libreofficekit/releases/download/cygdevenv/cygwin-snapshot.tar.xz
tar -xJf cygwin-snapshot.tar.xz -C /c &>/dev/null || true
MSYS=winsymlinks:lnk tar -xJf cygwin-snapshot.tar.xz -C /c || true
shell: bash
- name: Configure LOKit and Fetch Tarballs
if: steps.cache-external-tar.outputs.cache-hit != 'true'
env:
CHERE_INVOKING: 1
PARALLELISM: 4
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
md C:\external-tar
cd lok/libreoffice-core
C:\cygwin\bin\bash.exe --login
C:\cygwin\bin\bash.exe --login -c './autogen.sh --with-distro=LOKit-Win64 --with-external-tar="C:\external-tar"'
C:\cygwin\bin\bash.exe --login -c 'make fetch'
shell: cmd
build:
needs: [check_version, fetch]
if: ${{ needs.check_version.outputs.should_run != 'false' }}
runs-on: windows-2019-beefy
name: Build
steps:
- name: Remove Strawberry Perl from PATH (https://github.com/actions/runner-images/issues/8598 8622)
run: |
$env:PATH = $env:PATH -replace "C:\\Strawberry\\c\\bin;", ""
"PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Append
shell: powershell
- name: Turn off line ending conversion in git
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout
run: |
git -c protocol.version=2 clone --depth=1 --branch=${{github.ref_name}} --single-branch https://github.com/${{ github.repository }} /c/lok
cd /c/lok
git config --local gc.auto 0
shell: bash
- name: Speed up cache restore on Windows
shell: cmd
run: |
echo "Adding GNU tar to PATH"
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
- name: Install Cygwin
run: |
curl -LO https://github.com/coparse-inc/libreofficekit/releases/download/cygdevenv/cygwin-snapshot.tar.xz
tar -xJf cygwin-snapshot.tar.xz -C /c &>/dev/null || true
MSYS=winsymlinks:lnk tar -xJf cygwin-snapshot.tar.xz -C /c || true
shell: bash
- name: Cache external tarballs
id: cache-external-tar
uses: actions/cache@v3
with:
path: C:\external-tar
key: external-tar-${{ hashFiles('C:\lok\libreoffice-core\download.lst') }}-${{ hashFiles('C:\lok\libreoffice-core\external\**\*') }}
restore-keys: |
external-tar--${{ hashFiles('C:\lok\libreoffice-core\external\**\*') }}
external-tar--
external-tar-
- name: Build
env:
PARALLELISM: 4
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd /d C:\lok\libreoffice-core
C:\cygwin\bin\bash.exe --login
C:\cygwin\bin\bash.exe --login -c "cd /cygdrive/c/lok/libreoffice-core && ./autogen.sh --with-distro=LOKit-Win64 --with-external-tar='C:\external-tar'"
C:\cygwin\bin\bash.exe --login -c "cd /cygdrive/c/lok/libreoffice-core && make solenv Module_zlib Module_libpng Module_freetype Module_expat Module_fontconfig Module_cairo Module_icu Module_openssl Module_libffi Module_python3 Module_boost && make Module_nss || make Module_nss && make"
shell: cmd
- name: Make artifact
run: |
cd /c/lok/libreoffice-core
/usr/bin/tar -cJf libreofficekit.tar.xz instdir
mkdir debug
for i in instdir/program/*.dll; do
n="$(basename $i)"
p="${n%.*}.pdb"
t="workdir/LinkTarget/Library/$p"
if [ -e "$t" ]; then
cp "$t" "debug/$p"
fi
done
/usr/bin/tar -cJf debug-symbols.tar.xz debug
cp libreofficekit.tar.xz $GITHUB_WORKSPACE/libreofficekit-win.tar.xz
cp debug-symbols.tar.xz $GITHUB_WORKSPACE/debug-symbols-win.tar.xz
cd $GITHUB_WORKSPACE
sha256sum libreofficekit-win.tar.xz > libreofficekit-win.tar.xz.sha256sum
sha256sum debug-symbols-win.tar.xz > debug-symbols-win.tar.xz.sha256sum
shell: bash
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "libreofficekit-win.tar.xz,libreofficekit-win.tar.xz.sha256sum,debug-symbols-win.tar.xz,debug-symbols-win.tar.xz.sha256sum"
allowUpdates: true
artifactErrorsFailBuild: true
name: ${{ needs.check_version.outputs.version }}
tag: ${{ needs.check_version.outputs.version }}
body: |
This is an automated release built from the `main` branch.
For changes, please review the commit log.