Deployment

There are the two files

  • kwik-exporter: com.kwiksher.kwik5.exporter_PS.ccx
  • plugin.kwik: plugin.data.tgz
  1. kwik-visual-code: kwik-expoter

    • kwik-visual-code/develop/UXP/kwik-exporter
    • yarn build
    • git commit and push
    • gh action: Deploy Kwik Exporter

    kwik/base-proj is compiled in template-proj from sample-book’s gh action, and pluin’s gh action at the time of push or the workflow-dispatch manually

  2. kwik5-plugin

    • git commit and push
    • gh action: Deploy Kwik Solar2D base-proj
  3. kwik5-sample-book: Photoshop and App/book

    • git commit and push
    • gh action: Deploy Kwik Solar2D base-proj
  4. kwik5-template-project: build .ccx and then release

    the .ccx depends on kwik-visual-code: kwik-expporter, kwik5-plugin and kwik5-sample-book: main.lua etc with App/book

  5. kwik5-plugin_build: plugin-kwik.data.tgz

    • ./build.sh to upload it

    this has the symbolic link to kwik5-plugin, so just build the tgz of the latest lua files

graph LR

subgraph plugin[kwik5-plugin]
  src_lua[src ]
  plugin-yaml[[gh action: push ]]
end

plugin_build([kwik5-plugin_build <br> local])

subgraph UXP[kwik-visual-code]
  develop/UXP/src
  UXP-yaml[[gh action: build]]
end

subgraph kwik5-project-template
  subgraph Solar2D
    App(App main.lua etc)
  end

  subgraph exporter[UXP: kwik-exporter]
    src[kwik/base-proj/<br>Solar2D/App main.lua etc]
    src_template[kwik/base-proj/<br>Solar2D <br> plugin/kwik/template]
    mainjs[main.js icons <br> manifest.json]
    src_photoshop(kwik/base-proj/<br>Photoshop)
  end

  subgraph book[Photoshop:book]
    landscape.psd
    portrait.psd
    icon/
    kwik_ATN/
  end

  subgraph release-binaries
    plugin-kwik.data.tgz
    install.sh
    ccx[com.kwiksher.kwik5 <br>exporter-ps_PS.ccx]
  end
  ghaction[[release.yaml]]
end

subgraph samples[kwik5 sample books]
  photoshopBook[Photoshop/book icon kwikATN]
  appBook[App/book <br> main.lua etc]
  gh-base-proj[[gh action yaml]]
end

gh-base-proj --o appBook
gh-base-proj --o photoshopBook
gh-base-proj -. psd & lua   .-> exporter
gh-base-proj -. psd  .-> book
gh-base-proj -. lua  .-> Solar2D

UXP-yaml -. gh action build .-> mainjs
ghaction --o exporter
ghaction -.-> ccx

plugin -.-> plugin_build -. upload .-> plugin-kwik.data.tgz
plugin-yaml -. gh action:push <br> template files .-> src_template
plugin --o samples
  1. kwik exporter UXP to kwik5-project-template/UXP

    from kwik-visual-code/UXP/kwik-expoter

    to kwik5-project-template

  2. kwik5-plugin template to kwik5-project-template/UXP/kwik-exporter/

    from kwik5-plugin

    to kwik5-project-template

  3. kwik5-sample-books’s psds and App/book to kwik5-project-template

    from kwik5-sample-books

    to kwik5-project-template

steps

  1. cloud: kwik-visual-code repo

    • UXP kwik-visual-code > develop >UXP

    • gh action: kwik exporter to build the plugin/main.js

    • gh action: build.sh for building the plugin.data.tgz

      ```
      cd kwik-editor_plugin
      build.sh
      push lua/kwik5.lua, kwik5/* to kwik5tmplt/plugin/
      ```
      
  2. cloud: kwik5-projec-template repo

    • tar -czvf plugin.data.tgz -C Solar2D/plugin .

      • sed main.lua enable autoUpdate()
      • remove plugin dir in Solar2D for UXP and kwik5_project_yyyymmdd.zip
      • UXP/copy_solar2d.command, cp template from plugin/kwik/template, don’t copy plugin
       kwik.autoUpdate()
    • gh acton: release.yaml

      create .ccx with plugin/main.js and kwik/

      - name: Rename for ccx
        run: |
          cd UXP
          mv ${{env.CCX_Dir}} ${{env.CCX_NAME}}    
      
      - name: Archive Release exporter ccx
        uses: TheDoctor0/zip-release@0.7.6
        with:
          type: 'zip'
          directory: UXP
          path:  ${{env.CCX_NAME}}
          filename: ${{ env.CCX_NAME}}.exporter_PS.ccx
          exclusions: '*.git*'
      
      - name: Create Release
        id: create_release
        uses: softprops/action-gh-release@v2
        with:
          tag_name: ${{ env.CURRENT_DATETIME }}
          name: ${{ env.CURRENT_DATETIME }}
          draft: false
          prerelease: false
          files: |
            UXP/*.ccx      

Or manually build .ccx from kwik5-projec-template repo

  • pull the latest develop branch. it contains the built UXP files.

  • run the following copy commands

    UXP/kwik-exporter/kwik/base-proj is copied to Solar2D/ folder.

    cd UXP
    cp kwik-exporter com.kwiksher.kwik5
  • UXP Developer Tool > package it

    com.kwiksher.kwik5.exporter_PS.ccx

Release

the following zip files are downloaded and updated automatically in Solar2D simulator with the editor enabled

https://github.com/kwiksher/kwik5-project-template/releases

  • com.kwiksher.kwik5.exporter-ps_PS.ccx

the ccx is created by .github/workflows/release.yaml, and the plugin.data.tgz is manullay built locally and uploaded by build.sh in kwik5-plugin_build to append it to the latest release

user uses the install_plugin.sh in kwik5-project-template repo.


memo : push UXP to kwik5-plugin

graph LR

develop[kwik-visual-code > develop >UXP > kwik-exporter]

develop -. kwik-exporter yaml pushes .-> kwik5-prject-template

kwik-exporter.yaml

- name: Install dependencies & Build
  run: |
    npm install
    cp -f patches_backup/*.ts node_modules/react-uxp-spectrum/dist/
    npm run prod    
  working-directory: ./develop/UXP/kwik-exporter

  ...
  ...

  - name: List files
    run: |
      mkdir -p kwik5-project-template/UXP/kwik-exporter
      cp -rf develop/UXP/kwik-exporter/dist/* kwik5-project-template/UXP/kwik-exporter
      cp -rf develop/UXP/kwik-exporter/plugin/* kwik5-project-template/UXP/kwik-exporter
      cd kwik5-project-template
      git config --global user.email "yamamoto@kwiksher.com"
      git config --global user.name "kwiksher"
      git add -f UXP/kwik-exporter/*
      git commit -m "Update kwik exporter"      

  - name: Push changes
    uses: ad-m/github-push-action@master
    with:
      github_token: ${{ secrets.API_TOKEN_GITHUB }}
      branch: develop
      directory: kwik5-project-template
      repository: kwiksher/kwik5-project-template