feat: Release 2 new skills: platform-value-set-generate, dx-code-anal… #98
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | |
| git-push: "false" | |
| - name: Push release commit to main | |
| if: ${{ steps.changelog.outputs.skipped == 'false' }} | |
| env: | |
| GH_TOKEN: ${{ secrets.IDEE_GH_TOKEN }} | |
| run: | | |
| SHA=$(git rev-parse HEAD) | |
| TEMP_BRANCH="release-$(date +%s)" | |
| # Push commit to a temp branch so the SHA exists on the remote | |
| git push origin "$SHA:refs/heads/$TEMP_BRANCH" | |
| # Report the required status check on the now-visible commit | |
| gh api "repos/${{ github.repository }}/statuses/$SHA" \ | |
| -f state=success \ | |
| -f context=validate-skills \ | |
| -f description="Validated in release workflow" | |
| # Push to main (status check is now satisfied) | |
| git push origin main --follow-tags | |
| # Clean up temp branch | |
| git push origin --delete "$TEMP_BRANCH" || true | |
| - 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 }}"}' |