diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml deleted file mode 100644 index e57c040..0000000 --- a/.github/workflows/build-release.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Build and release library - -on: - push: - tags: - - 'v*' - workflow_dispatch: {} - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup Node - uses: actions/setup-node@v6 - with: - node-version: '24' - - - name: Install deps - run: npm ci - - - name: Build library - run: npm run build:library - - - name: Pack library zip - run: node ./scripts/pack-library.js - - - name: Create release - uses: softprops/action-gh-release@v2 - with: - tag_name: ${{ github.ref_name }} - name: Release ${{ github.ref_name }} - files: ./dfg-3dviewer-library.zip diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 1b24cb1..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,44 +0,0 @@ -stages: - - build - - release - -.build-base: - image: node:24-bookworm - before_script: - - apt-get update -qq && apt-get install -y -qq zip - rules: - - if: $CI_COMMIT_TAG - - if: $CI_PIPELINE_SOURCE == "web" - -build-library: - extends: .build-base - stage: build - script: - - npm ci - - npm run build:library - - node ./scripts/pack-library.js - artifacts: - paths: - - dfg-3dviewer-library.zip - expire_in: 4 weeks - -release-library: - stage: release - image: registry.gitlab.com/gitlab-org/cli:latest - needs: - - job: build-library - artifacts: true - rules: - - if: $CI_COMMIT_TAG - script: - - echo "Publishing release $CI_COMMIT_TAG" - release: - tag_name: $CI_COMMIT_TAG - name: 'Release $CI_COMMIT_TAG' - description: 'DFG 3D Viewer JavaScript library — extract to web/libraries/dfg-3dviewer/ on Drupal.' - assets: - links: - - name: dfg-3dviewer-library.zip - url: '${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_TAG}/raw/dfg-3dviewer-library.zip?job=build-library' - link_type: package - filepath: '/dfg-3dviewer-library.zip' diff --git a/README.md b/README.md index c8baf9a..39fba56 100644 --- a/README.md +++ b/README.md @@ -4,34 +4,18 @@ Three.js-based 3D viewer. Ships as a minified bundle for `web/libraries/dfg-3dvi **Drupal integration** is provided by the separate [`dfg_3dviewer`](https://gitlab.nasarek.dev/rnsrk/dfg_3dviewer_drupal_module) module. -## Build +## Build and package ```bash npm install npm run build:library +npm run pack:library ``` -Output in `dist/library/`: +Output: -- `dfg_3dviewer.min.js` -- `assets/` — CSS, draco, IFC WASM, fonts - -For local packaging (optional): - -```bash -npm run pack:library # creates dfg-3dviewer-library.zip (gitignored) -``` - -## Releases - -Tagged pushes build `dfg-3dviewer-library.zip` in CI and attach it to a GitLab Release. - -```bash -git tag v1.0.3 -git push origin v1.0.3 -``` - -Download the zip from [Releases](https://gitlab.nasarek.dev/rnsrk/dfg_3dviewer_js_library/-/releases) and extract to `web/libraries/dfg-3dviewer/` on Drupal. +- `dist/library/` — `dfg_3dviewer.min.js` and `assets/` (CSS, draco, IFC WASM, fonts) +- `dfg-3dviewer-library.zip` — extract to `web/libraries/dfg-3dviewer/` on Drupal (gitignored) ## Local development @@ -43,7 +27,7 @@ npm run dev:test ## Install on Drupal -1. Download `dfg-3dviewer-library.zip` from [Releases](https://gitlab.nasarek.dev/rnsrk/dfg_3dviewer_js_library/-/releases) and extract to `web/libraries/dfg-3dviewer/` +1. Build and pack locally (see above), then extract `dfg-3dviewer-library.zip` to `web/libraries/dfg-3dviewer/` 2. Enable the `dfg_3dviewer` Drupal module and configure at `/admin/config/dfg_3dviewer` ## Standalone embed @@ -58,6 +42,6 @@ Or pass config in code: `await Viewer.MainInit({ ... })`. ## Repository layout - `viewer/` — source -- `dist/` — build output (gitignored; run `npm run build:library` or download a Release zip) +- `dist/` — build output (gitignored; run `npm run build:library`) - `rollup.config.js` — production builds - `tests/` — Playwright E2E