v2.3.1 #69
Workflow file for this run
This file contains 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: | |
npm: | |
name: NPM | |
runs-on: ubuntu-latest | |
environment: NPM Release Publishing | |
steps: | |
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c | |
- run: corepack enable pnpm | |
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c | |
with: | |
node-version-file: ".nvmrc" | |
cache: pnpm | |
- uses: actions/github-script@e3cbab99d3a9b271e1b79fc96d103a4a5534998c | |
id: version | |
with: | |
script: | | |
const semver = context.ref.replace('refs/tags/v', '') | |
if (semver.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)){ | |
return semver | |
} | |
throw new Error('not semver') | |
result-encoding: string | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm build | |
- name: Version | |
run: | | |
node ./scripts/version.js --version ${{ steps.version.outputs.result }} | |
- name: Publish | |
run: | | |
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN | |
npm run publish | |
env: | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- name: Notify | |
id: slack | |
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0 | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_ORDZAAR_ENGINEERING }} | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | |
with: | |
payload: | | |
{ | |
"text": "Ordit SDK Released: ${{ github.event.release.name }}", | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "Ordit SDK Released\nRelease Version: ${{ github.event.release.name }}\nRelease Notes: https://github.com/sadoprotocol/ordit-sdk/releases/tag/${{ github.event.release.tag_name }}" | |
} | |
} | |
] | |
} |