Skip to content

GitHub Actions ​

The Node template generated by npx @dotmatrixlabs/create-dotx-plugin --node includes a ready-to-use workflow at .github/workflows/release-plugin.yml.

What it does ​

Triggered on any v* tag push, the workflow:

  1. Checks out the repository
  2. Sets up Node 20
  3. Installs dependencies
  4. Runs npm run release:verify-version — verifies the tag matches package.json and manifest.json versions
  5. Runs npm run package — builds dist/<plugin-name>.dotxplugin
  6. Uploads <plugin-name>.dotxplugin as a workflow artifact
  7. Publishes <plugin-name>.dotxplugin to the GitHub Release as an asset

Generated workflow ​

yaml
name: Release Plugin

on:
  push:
    tags:
      - 'v*'
  workflow_dispatch:

permissions:
  contents: write
  id-token: write

jobs:
  build-release:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
          registry-url: 'https://registry.npmjs.org'

      - name: Install dependencies
        run: npm install

      - name: Verify release version
        run: npm run release:verify-version
        env:
          RELEASE_TAG: ${{ github.ref_type == 'tag' && github.ref_name || '' }}

      - name: Build release package
        run: npm run package

      - name: Upload package artifact
        uses: actions/upload-artifact@v4
        with:
          name: plugin-package
          path: dist/*.dotxplugin
          if-no-files-found: error

      - name: Publish GitHub Release asset
        if: github.ref_type == 'tag'
        uses: softprops/action-gh-release@v2
        with:
          files: dist/*.dotxplugin
          fail_on_unmatched_files: true
          generate_release_notes: true
  1. Update manifest.json and package.json to the new version (e.g. 1.2.0)
  2. Commit and push your changes
  3. Push a version tag:
    bash
    git tag v1.2.0
    git push origin v1.2.0
  4. GitHub Actions builds and attaches dist/<plugin-name>.dotxplugin to the release automatically