Deploy

Lookup

Steps

  • publish regular build
EXT_TARGET=dendron
DENDRON_CLI=dendron
UPGRADE_TYPE=minor
PUBLISH_ENDPOINT=local

SKIP_SENTRY=1 LOG_LEVEL=info $DENDRON_CLI dev build --upgradeType $UPGRADE_TYPE --publishEndpoint $PUBLISH_ENDPOINT --fast --extensionTarget $EXT_TARGET

CI

create-release-image

  • .github/workflows/create-release-image.yml

  • BUILD_ENV=ci ensures that we use a local version of the ci to build

yarn build:minor:local:ci
"build:minor:local:ci": "cross-env UPGRADE_TYPE=minor PUBLISH_ENDPOINT=local BUILD_ENV=ci USE_IN_MEMORY_REGISTRY=1 ./bootstrap/scripts/buildPatch.sh",

publish extension

  • .github/workflows/publish-extension-dendron-minor.yml
yarn build:minor:remote:ci

verdaccio

Cook

Manual bump and publish plugin only

If you need to manually bump the current package version number for any reason without updating NPM

  • switch to local npm

    # source helpers 
    . bootstrap/scripts/helpers.sh
    # change registry to local endpoint
    setRegLocal
    

  • setup local npm registry

    This is necessary for actions that require pulling latest packages from NPM during development

    • start verdaccio in separate shell
    setRegLocal
    npx verdaccio -c ./bootstrap/data/verdaccio/config.yaml
    

  • bump plugin version

    Bump Plugin Version

    # values are "patch|minor"
    UPGRADE_TYPE=minor
    
    echo "bumping..."
    dendron dev bump_version --upgradeType $UPGRADE_TYPE
    

  • publish dependencies to npm

    echo "publishing packages..."
    lerna publish from-package --ignore-scripts
    

  • prepare package.json

    dendron dev prep_plugin && rm package.json
    

  • package plugin

    • package_plugin creates the vsix
    # NOTE: use `env SKIP_SENTRY=1` if not building with sentry support
    dendron dev package_plugin
    

  • publish to market place

    # FILL in OSVX value
    export OVSX_PAT=
    dendron dev prep_plugin
    VERSION=$(cat lerna.json | jq -r ".version")
    
    pushd packages/plugin-core
    PLUGIN_PKG=dendron-"$VERSION".vsix
    echo "publishing $PLUGIN_PKG..."
    yarn deploy:vscode:vsix $PLUGIN_PKG
    yarn deploy:ovsx:vsix $PLUGIN_PKG
    

  • reset

git reset --hard
  • publish to nextjs

    Steps

    These steps should be run after the weekly release has gone out. It is only needed to run these steps if we have changes to the nextjs-template

    Deploy to dev branch

    1. Make sure your current workspace is clean and stash changes otherwise

    2. Get the release version (NOTE: this should be the release AFTER publishing the release. the lerna.json should be updated to the latest minor version at this point)

      RELEASE_VERSION=
      git pull
      git checkout --track origin/$RELEASE_VERSION
      
      • eg: RELEASE_VERSION=release/0.81.0
    3. Update nextjs package

      • NOTE: we need to remove the workspace package.json to generate the lockfile correctly
      • #todo (Private): the following instructions are unix specific. we need to wrap this in a script that works also for windows
      rm package.json
      
      echo "sync nextjs-template..."
      VERSION=$(cat lerna.json | jq -r ".version")
      pushd packages/nextjs-template/
      
      echo "switch to dev branch..."
      git checkout --track -b origin/dev
      
      echo "backup node_modules..."
      mv node_modules /tmp
      
      echo "generating lockfile..."
      yarn
      
      echo "commit..."
      git add .
      git commit -m "chore(release): sync nextjs-template with dendron $VERSION"
      

    Verify dev branch

    1. Verify nextjs works in dev branch

    Deploy

    1. Push nextjs-template

      git push
      
      echo "restore node_modules..."
      mv node_modules /tmp/nextjs-nm
      mv /tmp/node_modules .
      popd
      
      echo "restore package.json"
      git checkout -- package.json
      
      echo "update nextjs commit to master"
      git add  "packages/nextjs-template/yarn.lock"
      git commit -m "chore: update nextjs lock file"
      git push
      

  • sync back to master

echo "sync back with master"
git checkout master
git merge --squash release/$VERSION
git commit -m "chore(release): publish $VERSION"
git push

test1345

  • clean up repo

    Start anchor fast-re-build not found

Common Cook Steps

Setup Local NPM Registry

This is necessary for actions that require pulling latest packages from NPM during development

  • start verdaccio in separate shell
setRegLocal
npx verdaccio -c ./bootstrap/data/verdaccio/config.yaml

Setup Environment Variables

The following need to be set

export GOOGLE_OAUTH_CLIENT_ID=
export GOOGLE_OAUTH_CLIENT_SECRET=
export SENTRY_AUTH_TOKEN=
export DENDRON_RELEASE_VERSION=

Bump Plugin Version

# values are "patch|minor"
UPGRADE_TYPE=minor

echo "bumping..."
dendron dev bump_version --upgradeType $UPGRADE_TYPE

Modify engine-server

  • file: scripts/build-modify-engine.sh

The generated-prisma-client has special .node files that is not compiled by webpack which is why we copy it over into the webpack dist folder when building the package.

Unfortunately, importing a missing file is not handled well by webpack.

Publish Node Dependencies to NPM

echo "publishing packages..."
lerna publish from-package --ignore-scripts

Prep package.json

dendron dev prep_plugin && rm package.json

Package Plugin

  • package_plugin creates the vsix
# NOTE: use `env SKIP_SENTRY=1` if not building with sentry support
dendron dev package_plugin

Install Plugin Locally

Drag and drop vsix to vscode

Publish From Artifact

# FILL in OSVX value
export OVSX_PAT=
dendron dev prep_plugin
VERSION=$(cat lerna.json | jq -r ".version")

pushd packages/plugin-core
PLUGIN_PKG=dendron-"$VERSION".vsix
echo "publishing $PLUGIN_PKG..."
yarn deploy:vscode:vsix $PLUGIN_PKG
yarn deploy:ovsx:vsix $PLUGIN_PKG

Index


Children
  1. Local
  2. Old

Backlinks