Skip to content

2.32.0

2.32.0 #69

Workflow file for this run

name: Publish
# Triggered manually or on release creation
on:
release:
types:
- created
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Allows GitHub Actions to generate OIDC tokens. See https://docs.github.com/en/actions/concepts/security/openid-connect.
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Cache Node dependencies
uses: actions/cache@v5
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Node
uses: actions/setup-node@v7
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
- name: Update npm
run: |
npm install -g npm@latest
npm --version
- name: Install dependencies
run: npm install
- name: Prepare and publish
run: |
npm run prepare
npm publish --access public --provenance
notify:
name: Notify Slack
needs: build
# Release context is only available when triggered by a release (not workflow_dispatch)
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- name: Send release announcement to Slack
env:
SLACK_WEBHOOK: ${{ secrets.RELEASES_SLACK_WEBHOOK }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
RELEASE_BODY: ${{ github.event.release.body }}
RELEASE_URL: ${{ github.event.release.html_url }}
run: |
# Extract the changelog from the release body:
# drop the "More info" trailer and the leading "- " list markers.
# Trailing blank lines are stripped by the command substitution.
changelog=$(printf '%s\n' "$RELEASE_BODY" | tr -d '\r' | sed -e '/^More info:/,$d' -e 's/^- //')
text=$(printf '*React-Native SDK version `%s`* is now available :rocket:\n```%s```\nhttps://www.npmjs.com/package/@didomi/react-native/v/%s\n%s' \
"$RELEASE_TAG" "$changelog" "$RELEASE_TAG" "$RELEASE_URL")
jq -n --arg text "$text" '{ text: $text }' \
| curl --silent --show-error --fail -X POST -H 'Content-Type: application/json' -d @- "$SLACK_WEBHOOK"