2022-05-13 21:52:35 +00:00
|
|
|
name: "Windows Build"
|
2021-02-20 09:13:44 +00:00
|
|
|
|
|
|
|
# any branch is useful for testing before a PR is submitted
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
2022-04-26 01:08:54 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-02-20 09:13:44 +00:00
|
|
|
jobs:
|
2022-05-13 21:52:35 +00:00
|
|
|
build-zip:
|
2021-02-20 09:13:44 +00:00
|
|
|
# run on pushes to any branch
|
|
|
|
# run on PRs from external forks
|
|
|
|
if: |
|
2022-01-28 06:33:52 +00:00
|
|
|
(github.event_name != 'pull_request')
|
|
|
|
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
|
2022-05-13 21:52:35 +00:00
|
|
|
name: Build .zip
|
2021-02-24 03:13:00 +00:00
|
|
|
runs-on: windows-latest
|
2021-02-20 09:13:44 +00:00
|
|
|
steps:
|
2022-01-28 06:33:52 +00:00
|
|
|
-
|
|
|
|
uses: msys2/setup-msys2@v2
|
|
|
|
with:
|
|
|
|
path-type: inherit
|
|
|
|
install: >-
|
|
|
|
zip
|
|
|
|
-
|
|
|
|
name: Checkout repository
|
2023-09-05 17:16:08 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-01-28 06:33:52 +00:00
|
|
|
-
|
2022-02-25 15:32:24 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-01-28 06:33:52 +00:00
|
|
|
with:
|
2023-06-26 17:11:32 +00:00
|
|
|
node-version: 20
|
2022-01-28 06:33:52 +00:00
|
|
|
cache: 'npm'
|
|
|
|
cache-dependency-path: |
|
|
|
|
src/package-lock.json
|
|
|
|
src/bin/doc/package-lock.json
|
|
|
|
-
|
2023-07-05 18:48:58 +00:00
|
|
|
name: Install the ep_etherpad-lite package from ./src
|
2023-09-04 19:57:10 +00:00
|
|
|
shell: msys2 {0}
|
|
|
|
run: src/bin/installDeps.sh
|
2023-07-05 18:48:58 +00:00
|
|
|
-
|
|
|
|
name: Run npm i once to make bin files available - why is this needed at all?
|
|
|
|
run: npm i
|
2022-01-28 06:33:52 +00:00
|
|
|
-
|
|
|
|
name: Run the backend tests
|
2023-09-04 19:57:10 +00:00
|
|
|
shell: msys2 {0}
|
2023-07-05 18:48:58 +00:00
|
|
|
run: cd src && npm run test-on-windows
|
2022-01-28 06:33:52 +00:00
|
|
|
-
|
|
|
|
name: Build the .zip
|
2023-09-04 19:57:10 +00:00
|
|
|
shell: msys2 {0}
|
|
|
|
run: src/bin/buildForWindows.sh
|
2022-01-28 06:33:52 +00:00
|
|
|
-
|
|
|
|
name: Archive production artifacts
|
2022-04-08 15:25:19 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-01-28 06:33:52 +00:00
|
|
|
with:
|
2022-05-13 00:14:45 +00:00
|
|
|
name: etherpad-win.zip
|
|
|
|
path: etherpad-win.zip
|
2021-02-20 09:13:44 +00:00
|
|
|
|
2022-05-13 21:52:35 +00:00
|
|
|
build-exe:
|
|
|
|
if: |
|
|
|
|
(github.event_name != 'pull_request')
|
|
|
|
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
|
|
|
|
name: Build .exe
|
|
|
|
needs: build-zip
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout repository
|
2023-09-05 17:16:08 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-05-13 21:52:35 +00:00
|
|
|
-
|
|
|
|
name: Download .zip
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: etherpad-win.zip
|
|
|
|
path: ..
|
|
|
|
-
|
|
|
|
name: Extract .zip
|
|
|
|
working-directory: ..
|
|
|
|
run: 7z x etherpad-win.zip -oetherpad-zip
|
|
|
|
-
|
|
|
|
name: Create installer
|
2023-06-20 15:58:14 +00:00
|
|
|
uses: joncloud/makensis-action@v3.7
|
2022-05-13 21:52:35 +00:00
|
|
|
with:
|
|
|
|
script-file: 'src/bin/nsis/etherpad.nsi'
|
|
|
|
-
|
|
|
|
name: Archive production artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: etherpad-win.exe
|
|
|
|
path: etherpad-win.exe
|
|
|
|
|
|
|
|
deploy-zip:
|
2021-02-20 09:13:44 +00:00
|
|
|
# run on pushes to any branch
|
|
|
|
# run on PRs from external forks
|
2022-04-26 01:08:54 +00:00
|
|
|
permissions:
|
2023-09-04 19:57:10 +00:00
|
|
|
contents: write
|
2021-02-20 09:13:44 +00:00
|
|
|
if: |
|
2022-01-28 06:33:52 +00:00
|
|
|
(github.event_name != 'pull_request')
|
|
|
|
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
|
2021-02-24 03:13:00 +00:00
|
|
|
name: Deploy
|
2022-05-13 21:52:35 +00:00
|
|
|
needs: build-zip
|
2021-02-20 09:13:44 +00:00
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
2022-01-28 06:33:52 +00:00
|
|
|
-
|
|
|
|
name: Download zip
|
2022-04-08 15:25:17 +00:00
|
|
|
uses: actions/download-artifact@v3
|
2022-01-28 06:33:52 +00:00
|
|
|
with:
|
2022-05-13 00:14:45 +00:00
|
|
|
name: etherpad-win.zip
|
2022-01-28 06:33:52 +00:00
|
|
|
-
|
|
|
|
name: Extract Etherpad
|
2022-05-13 00:14:45 +00:00
|
|
|
run: 7z x etherpad-win.zip -oetherpad
|
2022-01-28 06:33:52 +00:00
|
|
|
-
|
2022-02-25 15:32:24 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-01-28 06:33:52 +00:00
|
|
|
with:
|
2023-06-26 17:11:32 +00:00
|
|
|
node-version: 20
|
2022-01-28 06:33:52 +00:00
|
|
|
cache: 'npm'
|
|
|
|
cache-dependency-path: |
|
|
|
|
etherpad/src/package-lock.json
|
|
|
|
etherpad/src/bin/doc/package-lock.json
|
|
|
|
-
|
|
|
|
name: Install Cypress
|
2023-07-05 18:48:58 +00:00
|
|
|
run: cd etherpad && npm install cypress
|
2022-01-28 06:33:52 +00:00
|
|
|
-
|
|
|
|
name: Run Etherpad
|
|
|
|
run: |
|
|
|
|
cd etherpad
|
|
|
|
node node_modules\ep_etherpad-lite\node\server.js &
|
|
|
|
curl --connect-timeout 10 --max-time 20 --retry 5 --retry-delay 10 --retry-max-time 60 --retry-connrefused http://127.0.0.1:9001/p/test
|
2023-07-05 18:48:58 +00:00
|
|
|
node_modules\cypress\bin\cypress run --config-file src\tests\frontendcypress\cypress.config.js
|
2023-09-04 19:57:10 +00:00
|
|
|
# On release, upload windows zip to GitHub release tab
|
2023-07-05 18:48:58 +00:00
|
|
|
- name: Rename to etherpad-lite-win.zip
|
2023-09-04 19:57:10 +00:00
|
|
|
shell: powershell
|
|
|
|
run: mv etherpad-win.zip etherpad-lite-win.zip
|
|
|
|
- name: upload binaries to release
|
|
|
|
uses: softprops/action-gh-release@v1
|
2023-09-24 12:05:44 +00:00
|
|
|
if: ${{startsWith(github.ref, 'refs/tags/v') }}
|
2023-09-04 19:57:10 +00:00
|
|
|
with:
|
2023-07-05 18:48:58 +00:00
|
|
|
files: etherpad-lite-win.zip
|