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:
- Checks out the repository
- Sets up Node 20
- Installs dependencies
- Runs
npm run release:verify-version— verifies the tag matchespackage.jsonandmanifest.jsonversions - Runs
npm run package— buildsdist/<plugin-name>.dotxplugin - Uploads
<plugin-name>.dotxpluginas a workflow artifact - Publishes
<plugin-name>.dotxpluginto 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: trueRecommended release flow
- Update
manifest.jsonandpackage.jsonto the new version (e.g.1.2.0) - Commit and push your changes
- Push a version tag:bash
git tag v1.2.0 git push origin v1.2.0 - GitHub Actions builds and attaches
dist/<plugin-name>.dotxpluginto the release automatically