Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/windows build #5861

Merged
merged 12 commits into from
Aug 8, 2023
17 changes: 12 additions & 5 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@ jobs:
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: Build .zip
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
-
uses: msys2/setup-msys2@v2
with:
release: false
update: false
path-type: inherit
install: >-
zip
rsync
-
name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -35,16 +41,17 @@ jobs:
src/bin/doc/package-lock.json
-
name: Install all dependencies and symlink for ep_etherpad-lite
shell: msys2 {0}
run: src/bin/installDeps.sh
run: |
set MSYSTEM=winsymlinks:lnk
src/bin/installDeps.sh
-
name: Run the backend tests
shell: msys2 {0}
run: cd src && npm test
-
name: Build the .zip
shell: msys2 {0}
run: src/bin/buildForWindows.sh
run: |
set MSYSTEM=winsymlinks:lnk
src/bin/buildForWindows.sh
-
name: Archive production artifacts
uses: actions/upload-artifact@v3
Expand Down
6 changes: 4 additions & 2 deletions src/bin/buildForWindows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ try cd "${workdir}"
[ -f src/package.json ] || fatal "failed to cd to etherpad root directory"

# See https://github.com/msys2/MSYS2-packages/issues/1216
export MSYS=winsymlinks:lnk
export MSYSTEM=winsymlinks:lnk

OUTPUT=${workdir}/etherpad-win.zip

Expand All @@ -29,10 +29,12 @@ trap 'exit 1' HUP INT TERM
trap 'log "cleaning up..."; try cd / && try rm -rf "${TMP_FOLDER}"' EXIT

log "create a clean environment in $TMP_FOLDER..."
try git archive --format=tar HEAD | (try cd "${TMP_FOLDER}" && try tar xf -) \
try export GIT_WORK_TREE=${TMP_FOLDER}; git checkout HEAD -f \
|| fatal "failed to copy etherpad to temporary folder"
try mkdir "${TMP_FOLDER}"/.git
try git rev-parse HEAD >${TMP_FOLDER}/.git/HEAD
try cp -r ./src/node_modules "${TMP_FOLDER}"/src/node_modules

try cd "${TMP_FOLDER}"
[ -f src/package.json ] || fatal "failed to copy etherpad to temporary folder"

Expand Down
Loading