mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 07:35:05 -04:00

* fix bin folder and workflows as far its possible cleanup of dockerfile changed paths of scripts add lock file fix working directory for workflows fix windows bin fix travis (is travis used anyway?) fix package refs remove pnpm-lock file in root as these conflicts with the docker volume setup optimize comments use install again refactor prod image call to run fix --workspace can only be used inside a workspace correct comment try fix pipeline try fix pipeline for upgrade-from-latest-release install all deps smaller adjustments save update dockerfile remove workspace command fix run test command start repair latest release workflow start repair latest release workflow start repair latest release workflow further repairs * remove test plugin from docker compose
164 lines
4.9 KiB
YAML
164 lines
4.9 KiB
YAML
name: "Windows Build"
|
|
|
|
# any branch is useful for testing before a PR is submitted
|
|
on: [push, pull_request]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build-zip:
|
|
# run on pushes to any branch
|
|
# run on PRs from external forks
|
|
if: |
|
|
(github.event_name != 'pull_request')
|
|
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
|
|
name: Build .zip
|
|
runs-on: windows-latest
|
|
steps:
|
|
-
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
path-type: inherit
|
|
install: >-
|
|
zip
|
|
-
|
|
name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
-
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 21
|
|
- uses: pnpm/action-setup@v3
|
|
name: Install pnpm
|
|
with:
|
|
version: 8
|
|
run_install: false
|
|
- name: Get pnpm store directory
|
|
shell: bash
|
|
run: |
|
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
- uses: actions/cache@v4
|
|
name: Setup pnpm cache
|
|
with:
|
|
path: ${{ env.STORE_PATH }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
- name: Only install direct dependencies
|
|
run: pnpm config set auto-install-peers false
|
|
-
|
|
name: Install all dependencies and symlink for ep_etherpad-lite
|
|
shell: msys2 {0}
|
|
run: bin/installDeps.sh
|
|
-
|
|
name: Run the backend tests
|
|
shell: msys2 {0}
|
|
run: cd src && pnpm test
|
|
-
|
|
name: Build the .zip
|
|
shell: msys2 {0}
|
|
run: bin/buildForWindows.sh
|
|
-
|
|
name: Archive production artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: etherpad-win.zip
|
|
path: etherpad-win.zip
|
|
|
|
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
|
|
uses: actions/checkout@v4
|
|
-
|
|
name: Download .zip
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: etherpad-win.zip
|
|
path: ..
|
|
-
|
|
name: Extract .zip
|
|
working-directory: ..
|
|
run: 7z x etherpad-win.zip -oetherpad-zip
|
|
-
|
|
name: Create installer
|
|
uses: joncloud/makensis-action@v4.1
|
|
with:
|
|
script-file: 'bin/nsis/etherpad.nsi'
|
|
-
|
|
name: Archive production artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: etherpad-win.exe
|
|
path: etherpad-win.exe
|
|
|
|
deploy-zip:
|
|
# run on pushes to any branch
|
|
# run on PRs from external forks
|
|
permissions:
|
|
contents: write
|
|
if: |
|
|
(github.event_name != 'pull_request')
|
|
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
|
|
name: Deploy
|
|
needs: build-zip
|
|
runs-on: windows-latest
|
|
steps:
|
|
-
|
|
name: Download zip
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: etherpad-win.zip
|
|
-
|
|
name: Extract Etherpad
|
|
run: 7z x etherpad-win.zip -oetherpad
|
|
-
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
- uses: pnpm/action-setup@v3
|
|
name: Install pnpm
|
|
with:
|
|
version: 8
|
|
run_install: false
|
|
- name: Get pnpm store directory
|
|
shell: bash
|
|
run: |
|
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
- uses: actions/cache@v4
|
|
name: Setup pnpm cache
|
|
with:
|
|
path: ${{ env.STORE_PATH }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
- name: Only install direct dependencies
|
|
run: pnpm config set auto-install-peers false
|
|
- name: Install all dependencies and symlink for ep_etherpad-lite
|
|
run: .\bin\installOnWindows.bat
|
|
working-directory: etherpad
|
|
-
|
|
name: Run Etherpad
|
|
working-directory: etherpad/src
|
|
run: |
|
|
.\node_modules\.bin\cypress.cmd install --force
|
|
pnpm run prod &
|
|
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
|
|
pnpm exec cypress run --config-file ./tests/frontend/cypress/cypress.config.js
|
|
# On release, upload windows zip to GitHub release tab
|
|
-
|
|
name: Rename to etherpad-lite-win.zip
|
|
shell: powershell
|
|
run: mv etherpad-win.zip etherpad-lite-win.zip
|
|
- name: upload binaries to release
|
|
uses: softprops/action-gh-release@v1
|
|
if: ${{startsWith(github.ref, 'refs/tags/v') }}
|
|
with:
|
|
files: etherpad-lite-win.zip
|