-
Notifications
You must be signed in to change notification settings - Fork 25
48 lines (40 loc) · 1.52 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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