afv-library/.github/workflows/release-skills.yml
Mohan Raj Rajamanickam 2320c50264
ci: publish skills as @salesforce/afv-skills npm package @W-21534193@ (#30)
* ci: update package details and add GitHub workflows for skills validation and release

* chore: update Node version, change license, and refactor skills validation script to TypeScript

* chore: remove unused deps

* fix: npm package

* fix: flatten skills to pass validation

* chore: add validation script to package.json and update GitHub workflow to use it

* chore: enhance skills validation and update workflows for npm publishing

* refactor: streamline skills validation process in workflow and script

* refactor: improve documentation and structure of skills validation script

* implement checks based on jeff's best practices doc

* chore: add pull request template for skill submissions

* chore: update pull request template with additional references and improve automated checks section

* chore: update pull request template to clarify naming convention with a warning for gerund form

* chore: update pull request template to reference skill authoring guide and enhance checklist structure

* chore: enhance GitHub workflows for skills validation and release process

* refactor: improve parsing logic for SKILL.md files and enhance error collection in validation

* chore: update validation checks to enforce character limits for skill names and descriptions

* fix: remove unnecessary whitespace in footer string in validate-skills.ts
2026-03-12 13:41:52 -07:00

92 lines
2.8 KiB
YAML

name: release-skills
on:
push:
branches: [main]
paths: ['skills/**']
workflow_dispatch:
inputs:
ref:
description: "Branch or tag to release from (must be main)"
required: false
default: main
permissions:
contents: write
packages: write
jobs:
release:
runs-on: ubuntu-latest
outputs:
skipped: ${{ steps.changelog.outputs.skipped }}
version: ${{ steps.changelog.outputs.version }}
steps:
- name: Require main branch
if: github.event_name == 'workflow_dispatch'
run: |
if [ "${{ github.ref_name }}" != "main" ]; then
echo "Releases must be run from the main branch (got '${{ github.ref_name }}')."
exit 1
fi
- uses: actions/checkout@v4
with:
token: ${{ secrets.IDEE_GH_TOKEN }}
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- run: npm ci
- name: Validate skills
run: npm run validate:skills
- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v5
with:
git-user-name: svc-idee-bot
git-user-email: svc_idee_bot@salesforce.com
github-token: ${{ secrets.IDEE_GH_TOKEN }}
tag-prefix: ""
release-count: "0"
skip-on-empty: ${{ github.event_name == 'push' }}
version-file: "package.json"
output-file: "CHANGELOG.md"
- name: Create Github Release
id: release
uses: ncipollo/release-action@v1
if: ${{ steps.changelog.outputs.skipped == 'false' }}
with:
name: "${{ steps.changelog.outputs.version }}"
tag: "${{ steps.changelog.outputs.version }}"
commit: ${{ github.sha }}
body: |
## Changes in @salesforce/afv-skills
${{ steps.changelog.outputs.clean_changelog }}
token: ${{ secrets.IDEE_GH_TOKEN }}
skipIfReleaseExists: true
- name: Publish to npm
id: publish
if: ${{ steps.changelog.outputs.skipped == 'false' && steps.release.outputs.id != '' }}
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
npm publish --access public
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Notify cline-fork
if: ${{ steps.changelog.outputs.skipped == 'false' && steps.release.outputs.id != '' && steps.publish.outcome == 'success' }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.IDEE_GH_TOKEN }}
repository: forcedotcom/cline-fork
event-type: skills-released
client-payload: '{"version": "${{ steps.changelog.outputs.version }}"}'