Fix clipboard events (#99) #152
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |