Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 129 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:

- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
uses: docker/build-push-action@v7
with:
context: docker-build
file: docker-build/Dockerfile
Expand Down Expand Up @@ -274,3 +274,131 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') }}
files: artifacts/*


deploy:
needs: [build-matrix]
runs-on: ubuntu-22.04
permissions:
contents: read
env:
SYSTEMD_DIR: /etc/systemd/system
WORK_DIR: ${{vars.WORK_DIR}}
HOST_IP: ${{ secrets.HOST_IP }}
HOST_USER: ${{ secrets.HOST_USER }}
HOST_SSH: ${{ secrets.HOST_SSH }}
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Determine deploy target
id: deploy_target
shell: bash
run: |
set -euo pipefail

TAG_NAME="${GITHUB_REF_NAME}"
DEPLOY_VARIANT="main"
SERVICE_SUFFIX=""

if [[ "$TAG_NAME" == *-alpha ]]; then
DEPLOY_VARIANT="alpha"
SERVICE_SUFFIX="-alpha"
elif [[ "$TAG_NAME" == *-beta ]]; then
DEPLOY_VARIANT="beta"
SERVICE_SUFFIX="-beta"
fi

echo "deploy_variant=$DEPLOY_VARIANT" >> "$GITHUB_OUTPUT"
echo "remote_work_dir=${WORK_DIR}/${DEPLOY_VARIANT}" >> "$GITHUB_OUTPUT"
echo "service_suffix=$SERVICE_SUFFIX" >> "$GITHUB_OUTPUT"
echo "service_name=wp-editor${SERVICE_SUFFIX}.service" >> "$GITHUB_OUTPUT"

- name: Download Linux amd64 artifact
uses: actions/download-artifact@v7
with:
name: ${{ github.event.repository.name }}-${{ github.ref_name }}-x86_64-unknown-linux-gnu
path: deploy-artifact

- name: Prepare deploy bundle
shell: bash
env:
DEPLOY_VARIANT: ${{ steps.deploy_target.outputs.deploy_variant }}
run: |
set -euo pipefail

rm -rf deploy-bundle
mkdir -p deploy-bundle

tar -xzf deploy-artifact/*.tar.gz -C deploy-artifact
cp -a "dev-ops/${DEPLOY_VARIANT}/." deploy-bundle/
rm -f deploy-bundle/wp-editor.service
cp deploy-artifact/artifacts/wp-editor deploy-bundle/wp-editor
chmod +x deploy-bundle/wp-editor

- name: Configure SSH
shell: bash
run: |
set -euo pipefail

mkdir -p ~/.ssh
chmod 700 ~/.ssh
printf '%s\n' "$HOST_SSH" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H "$HOST_IP" >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts

- name: Render service file
shell: bash
env:
REMOTE_WORK_DIR: ${{ steps.deploy_target.outputs.remote_work_dir }}
run: |
set -euo pipefail

sed "s|\${WORK_DIR}|${REMOTE_WORK_DIR}|g" dev-ops/alpha/wp-editor.service > service.rendered

- name: Stop service and clean remote directory
shell: bash
env:
SERVICE_NAME: ${{ steps.deploy_target.outputs.service_name }}
REMOTE_WORK_DIR: ${{ steps.deploy_target.outputs.remote_work_dir }}
run: |
set -euo pipefail

ssh "$HOST_USER@$HOST_IP" "SERVICE_NAME='$SERVICE_NAME' WORK_DIR='$REMOTE_WORK_DIR' bash -s" <<'EOF'
set -euo pipefail
sudo systemctl stop "$SERVICE_NAME" || true
sudo mkdir -p "$WORK_DIR"
sudo chown -R "$USER":"$USER" "$WORK_DIR"
shopt -s dotglob nullglob
files=("$WORK_DIR"/*)
if [ ${#files[@]} -gt 0 ]; then
rm -rf "${files[@]}"
fi
EOF

- name: Upload deploy bundle
shell: bash
env:
REMOTE_WORK_DIR: ${{ steps.deploy_target.outputs.remote_work_dir }}
run: |
set -euo pipefail

tar -C deploy-bundle -cf - . | ssh "$HOST_USER@$HOST_IP" "tar -C '$REMOTE_WORK_DIR' -xf -"
scp service.rendered "$HOST_USER@$HOST_IP:/tmp/service.rendered"

- name: Install service and restart
shell: bash
env:
SERVICE_NAME: ${{ steps.deploy_target.outputs.service_name }}
SYSTEMD_TARGET: ${{ env.SYSTEMD_DIR }}/${{ steps.deploy_target.outputs.service_name }}
run: |
set -euo pipefail

ssh "$HOST_USER@$HOST_IP" "SERVICE_NAME='$SERVICE_NAME' SYSTEMD_TARGET='$SYSTEMD_TARGET' bash -s" <<'EOF'
set -euo pipefail
sudo install -m 0644 /tmp/service.rendered "$SYSTEMD_TARGET"
rm -f /tmp/service.rendered
sudo systemctl daemon-reload
sudo systemctl start "$SERVICE_NAME"
EOF
207 changes: 207 additions & 0 deletions CHANGELOG.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,213 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.19.2-alpha] - 2026-04-30

### Changed

- Upgrade wp-motor-related dependencies to v1.21.7 and synchronize the related dependency versions and source references in `Cargo.lock`
- Update the alpha `systemd` service configuration so `ExecStart` and `WorkingDirectory` point directly to `${WORK_DIR}/wp-editor` and `${WORK_DIR}`, simplifying the deployment path layout

## [1.17.2-alpha] - 2026-04-23

### Changed

- Unified version identifiers to `1.17.2` / `v1.17.2-alpha` (synchronized in `Cargo.toml`, `Cargo.lock`, `version.txt`, and `dist/install-manifest-alpha.json`)
- Upgrade wp-motor-related dependencies to v1.21.4
- Add the Chinese and English changelog entries for `1.17.2-alpha`
- Fix the grammatical errors caused by the oml formatting.

## [1.17.0-alpha] - 2026-04-16

### Changed

- Upgrade wp-motor dependency to v1.20.3
- Synchronize wp-motor-related dependency versions and source references in `Cargo.lock`
- Bump the locked `wp-lang` version to `0.1.10`

## [1.16.0-beta] - 2026-04-16

### Added

- Add a Prometheus metrics endpoint at `/metrics`

### Changed

- Merge changes from the `alpha` branch into `beta`
- Upgrade wp-motor dependency to v1.19.16
- Restore `Cargo.lock` and synchronize the dependency lock state for the beta release
- Update beta release manifest `dist/install-manifest-beta.json`, changing the release version to `v1.16.0-beta`
- Update WPL Tree-sitter highlight queries and `tree-sitter-wpl.wasm` assets to support the new syntax nodes
- Convert the OML transformation and example loading pipeline to async implementations, covering `debug_transform`, `debug_examples`, `oml_examples`, and `convert_record`

### Fixed

- Adapt to upstream API changes for `OMLCodeError`, `WparseReason`, `FieldQueryCache`, and related interfaces
- Fix recursive OML example loading and error propagation issues
- Fix `/metrics` log filtering to avoid polluting normal request logs

## [1.15.4-alpha] - 2026-04-08

### Changed

- Unified version identifiers to `1.15.4` / `v1.15.4-alpha` (synchronized in `Cargo.toml`, `version.txt`, and `dist/install-manifest-alpha.json`)
- Restore `web/package-lock.json` and adjust ignore rules so frontend dependency lock results are shipped with the release

## [1.15.3-alpha] - 2026-04-08

### Added

- Add a Prometheus metrics endpoint at `/metrics`

### Changed

- Assign stable metric names for Actix HTTP metrics
- Update access log filtering rules to exclude `/metrics`
- Adjust lockfile commit strategy by removing `Cargo.lock` and `web/package-lock.json`

## [1.15.2-alpha] - 2026-04-07

### Changed

- Unified version identifiers to `1.15.2` / `v1.15.2-alpha` (synchronized in `Cargo.toml`, `Cargo.lock`, `version.txt`, and `dist/install-manifest-alpha.json`)
- Refactor the README and update release process documentation, consolidating into a single bilingual document
- Optimize frontend chunk splitting and dev-time dependency pre-bundling to reduce fragmented requests during refresh
- Add tiered caching rules for static assets, distinguishing the entry page, hashed assets, and other static files

### Fixed

- Make unmatched `/api/*` routes return JSON 404 responses instead of falling back to the frontend page

### Performance

- Enable gzip/deflate compression by default to reduce frontend asset transfer size

### Removed

- Remove the standalone `README.en.md`

## [1.15.1-alpha] - 2026-04-03

### Changed

- Unified version identifiers to `1.15.1` / `v1.15.1-alpha` (synchronized in `Cargo.toml`, `Cargo.lock`, `version.txt`, and `dist/install-manifest-alpha.json`)

### Fixed

- Update `Cargo.lock` to synchronize the dependency lock state

## [1.15.0-alpha] - 2026-04-03

### Changed

- Unified version identifiers to `1.15.0` / `v1.15.0-alpha` (synchronized in `Cargo.toml`, `Cargo.lock`, `version.txt`, and `dist/install-manifest-alpha.json`)
- Upgrade wp-motor dependency to v1.19.16
- Switch `wp-lang` and `wp-knowledge` to standalone versioned dependencies to adapt to upstream package splitting
- Convert the OML transformation and example loading pipeline to async implementations, covering `debug_transform`, `debug_examples`, `oml_examples`, and `convert_record`

### Fixed

- Fix error propagation and `Future` handling in recursive OML example loading
- Adapt to import path changes for `OMLCodeError`, `WparseReason`, and related types
- Convert related integration tests and example tests to async and add the missing `await`

## [1.14.2] - 2026-04-07

### Changed

- Version update to 1.14.2
- Refactor the README and update release process documentation, consolidating into a single bilingual document
- Optimize frontend chunk splitting and dev-time dependency pre-bundling to reduce fragmented requests during refresh
- Add tiered caching rules for static assets, distinguishing the entry page, hashed assets, and other static files

### Fixed

- Make unmatched `/api/*` routes return JSON 404 responses instead of falling back to the frontend page

### Performance

- Enable gzip/deflate compression by default to reduce frontend asset transfer size

### Removed

- Remove the standalone `README.en.md`

## [1.14.2-beta] - 2026-04-07

### Changed

- Unified version identifiers to `1.14.2` / `v1.14.2-beta` (synchronized in `Cargo.toml`, `Cargo.lock`, `version.txt`, and `dist/install-manifest-beta.json`)
- Refactor the README and update release process documentation, consolidating into a single bilingual document
- Optimize frontend chunk splitting and dev-time dependency pre-bundling to reduce fragmented requests during refresh
- Add tiered caching rules for static assets, distinguishing the entry page, hashed assets, and other static files

### Fixed

- Make unmatched `/api/*` routes return JSON 404 responses instead of falling back to the frontend page

### Performance

- Enable gzip/deflate compression by default to reduce frontend asset transfer size

### Removed

- Remove the standalone `README.en.md`

## [1.14.1] - 2026-04-03

### Changed

- Version update to 1.14.1
- Fine-tune copy in `README.md` and `README.en.md`
- Update the stable release manifest `dist/install-manifest.json`

### Fixed

- Update `Cargo.lock` to synchronize the dependency lock state

## [1.14.1-beta] - 2026-04-03

### Changed

- Unified version identifiers to `1.14.1` / `v1.14.1-beta` (synchronized in `Cargo.toml`, `Cargo.lock`, `version.txt`, and `dist/install-manifest-beta.json`)

### Fixed

- Update `Cargo.lock` to synchronize the dependency lock state

## [1.14.0] - 2026-04-03

### Added

- Add `CONTRIBUTING.md` with contribution guidelines and collaboration instructions

### Changed

- Version update to 1.14.0
- Change the license from Elastic License 2.0 to Apache 2.0
- Refactor the README, add bilingual documentation, and align Chinese and English content
- Update the stable release manifest `dist/install-manifest.json`

### Removed

- Remove the Test Coverage badge and the usage guide and API documentation sections from the README

## [1.14.0-beta] - 2026-04-01

### Added

- Add one-click copy/paste support to the code editor

### Changed

- Unified version identifiers to `1.14.0` / `v1.14.0-beta` (synchronized in `Cargo.toml`, `Cargo.lock`, `version.txt`, and `dist/install-manifest-beta.json`)
- Upgrade wp-motor dependency to v1.18.3

### Fixed

- Fix abnormal `Tab` key behavior in the editor
- Add `Shift+Tab` support for reverse indentation

## [1.13.0-alpha] - 2026-03-12

### Changed
Expand Down
Loading
Loading