@W-22934319: [API Management] Add manage-api-version Vibes skill (#148) #19
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: [master] | |
| paths: ['skills/mule-development/**'] | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write # Required for OIDC authentication (npm trusted publishing) | |
| defaults: | |
| run: | |
| working-directory: skills/mule-development | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Upgrade npm for trusted publishing | |
| run: npm install -g npm@11.9.0 | |
| - name: Check if version is already published | |
| id: check | |
| run: | | |
| NAME=$(node -p "require('./package.json').name") | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "name=$NAME" >> "$GITHUB_OUTPUT" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| if npm view "$NAME@$VERSION" version > /dev/null 2>&1; then | |
| echo "$NAME@$VERSION is already published — skipping." | |
| echo "should_publish=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "$NAME@$VERSION not yet published — will publish." | |
| echo "should_publish=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Publish to npm | |
| if: steps.check.outputs.should_publish == 'true' | |
| run: npm publish --access public --provenance=true |