Build & Publish to NPM #41
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: 'Build & Publish to NPM' | |
on: | |
push: | |
tags: | |
- v** | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
cancel-in-progress: false | |
permissions: | |
contents: read | |
jobs: | |
build-and-publish: | |
name: Build & Publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: 👀 Checkout | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: 🏷 Set vars | |
id: vars | |
run: | | |
echo "package-version=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT | |
echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
echo "npm-tag=$(node ./scripts/pkg.get-tag.js)" >> $GITHUB_OUTPUT | |
- name: 🛠️ Set up environment | |
uses: ./.github/actions/setup | |
with: | |
cocoa-pods: true | |
- name: 🚀 Publish to NPM | |
run: npm publish --tag "$NPM_TAG" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NPM_TAG: ${{ steps.vars.outputs.npm-tag }} | |
- name: 🗒 Add summary | |
if: ${{ success() }} | |
run: | | |
echo 'RN SDK [${{ steps.vars.outputs.tag }}](https://github.com/Giphy/giphy-react-native-sdk/releases/tag/${{ steps.vars.outputs.tag }}) released.' >> $GITHUB_STEP_SUMMARY | |
echo 'Release: <https://github.com/Giphy/giphy-react-native-sdk/releases/tag/${{ steps.vars.outputs.tag }}>' >> $GITHUB_STEP_SUMMARY | |
echo 'NPM: <https://www.npmjs.com/package/@giphy/react-native-sdk/v/${{ steps.vars.outputs.package-version }}>' >> $GITHUB_STEP_SUMMARY |