Release 1.4.1 #9
Workflow file for this run
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
| # https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | |
| name: Publish Package to npmjs | |
| on: | |
| release: | |
| types: | |
| - published | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the branch | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| registry-url: https://registry.npmjs.org | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Publish | |
| run: npm publish --provenance | |
| - name: Notify Discord of Release | |
| env: | |
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| REPO: ${{ github.event.repository.name }} | |
| TITLE: ${{ github.event.release.name || github.event.release.tag_name }} | |
| URL: ${{ github.event.release.html_url }} | |
| NOTES: ${{ github.event.release.body }} | |
| run: | | |
| payload=$(jq -n \ | |
| --arg title "$REPO — $TITLE" \ | |
| --arg url "$URL" \ | |
| --arg desc "$NOTES" \ | |
| '{ | |
| embeds: [{ | |
| title: $title, | |
| url: $url, | |
| description: ($desc | if length > 4000 then .[0:3997] + "…" else . end), | |
| color: 5814783 | |
| }] | |
| }') | |
| curl -sf -X POST -H "Content-Type: application/json" \ | |
| -d "$payload" "$DISCORD_WEBHOOK_URL" |