v6.6.1 #344
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
| name: Publish | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout 🛎️ | |
| uses: actions/checkout@v4 | |
| - name: pnpm 🧰 | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Node 🧰 | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 20.x | |
| registry-url: https://registry.npmjs.org | |
| cache: 'pnpm' | |
| - name: Update npm 📦 | |
| run: npm install -g npm@latest | |
| - name: Install 📦 | |
| run: pnpm install | |
| - name: Build elements 🛠 | |
| run: pnpm build:elements | |
| - name: Publish 🚀 PRERELEASE | |
| if: 'github.event.release.prerelease' | |
| run: pnpm -r publish --tag next --no-git-checks --access public | |
| - name: Publish 🚀 PRODUCTION | |
| if: '!github.event.release.prerelease' | |
| run: pnpm -r publish --no-git-checks --access public | |
| - name: Trigger deploy to gh-pages 🚀 | |
| # if: '!github.event.release.prerelease' | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.COMMERCELAYER_CI_TOKEN }} | |
| script: | | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| ref: context.ref, | |
| workflow_id: 'gh-pages.yaml' | |
| }); | |
| - name: Post to a Slack channel | |
| id: slack | |
| uses: slackapi/slack-github-action@v1.26.0 | |
| with: | |
| # Slack channel id, channel name, or user id to post message. | |
| # See also: https://api.slack.com/methods/chat.postMessage#channels | |
| # channel-id: 'pipeline' | |
| # For posting a rich message using Block Kit | |
| payload: | | |
| { | |
| "text": "New release ${{github.ref_name}} for ${{github.event.repository.name}}.", | |
| "blocks": [ | |
| { | |
| "type": "section", | |
| "text": { | |
| "type": "mrkdwn", | |
| "text": "New release for <${{github.event.repository.html_url}}|`${{github.event.repository.name}}`>\n*<${{github.event.release.html_url}}|release notes>*" | |
| } | |
| }, | |
| { | |
| "type": "section", | |
| "fields": [ | |
| { | |
| "type": "mrkdwn", | |
| "text": "*Project:*\n${{github.event.repository.name}}" | |
| }, | |
| { | |
| "type": "mrkdwn", | |
| "text": "*Version:*\n${{github.ref_name}}" | |
| } | |
| ] | |
| }, | |
| { | |
| "type": "context", | |
| "elements": [ | |
| { | |
| "type": "image", | |
| "image_url": "${{github.event.sender.avatar_url}}", | |
| "alt_text": "${{github.event.sender.login}}" | |
| }, | |
| { | |
| "type": "mrkdwn", | |
| "text": "*${{github.event.sender.login}}* has triggered this release." | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.PIPELINE_SLACK_CHANNEL_WEBHOOK_URL }} | |
| SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |