chore: version packages (#203) #280
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 | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'pnpm' | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run build | |
| - name: Create Release PR or Publish | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| publish: pnpm changeset:publish | |
| version: pnpm changeset:version | |
| title: 'chore: version packages' | |
| commit: 'chore: version packages' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: 'true' | |
| HUSKY: '0' | |
| - name: Generate SBOM | |
| if: steps.changesets.outputs.published == 'true' | |
| run: pnpm run sbom | |
| - name: Upload SBOM as release artifact | |
| if: steps.changesets.outputs.published == 'true' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sbom-cyclonedx | |
| path: sbom.json | |
| retention-days: 90 | |
| - name: Notify Discord on release | |
| if: steps.changesets.outputs.published == 'true' | |
| env: | |
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| run: | | |
| if [ -z "$DISCORD_WEBHOOK_URL" ]; then | |
| echo "DISCORD_WEBHOOK_URL not set — skipping notification" | |
| exit 0 | |
| fi | |
| curl -H "Content-Type: application/json" \ | |
| -d '{ | |
| "embeds": [{ | |
| "title": "create-helix released!", | |
| "description": "A new version of `create-helix` has been published to npm!\n\n**Install:** `npm create helix`\n**npx:** `npx create-helix`", | |
| "color": 5025616, | |
| "fields": [ | |
| { "name": "Package", "value": "[create-helix](https://www.npmjs.com/package/create-helix)", "inline": true }, | |
| { "name": "Repository", "value": "[GitHub](https://github.com/bookedsolidtech/create-helix-app)", "inline": true } | |
| ], | |
| "footer": { "text": "Booked Solid - HELiX Ecosystem" }, | |
| "timestamp": "'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'" | |
| }] | |
| }' \ | |
| "$DISCORD_WEBHOOK_URL" |