Skip to content

Commit 2c6722d

Browse files
committed
Merge branch 'main' into 2.29-stable
2 parents bed9604 + b75bb5c commit 2c6722d

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build package and publish on npm
2+
env:
3+
YARN_ENABLE_HARDENED_MODE: 0
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
npm-build:
9+
if: github.repository == 'software-mansion/react-native-gesture-handler'
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write # for OIDC
14+
env:
15+
PACKAGE_NAME: PLACEHOLDER # Will be reassigned later on.
16+
steps:
17+
- name: Check out
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node
21+
uses: actions/setup-node@v6
22+
with:
23+
node-version: 24
24+
cache: 'yarn'
25+
registry-url: https://registry.npmjs.org/
26+
27+
# Ensure npm 11.5.1 or later is installed for OIDC
28+
- name: Update npm
29+
run: npm install -g npm@latest
30+
31+
- name: Install node dependencies
32+
run: yarn install --immutable
33+
34+
- name: Build package
35+
id: build
36+
working-directory: packages/react-native-gesture-handler
37+
run: npm pack
38+
39+
- name: Add package name to env
40+
working-directory: packages/react-native-gesture-handler
41+
run: echo "PACKAGE_NAME=$(ls -l | egrep -o "react-native-gesture-handler-(.*)(=?\.tgz)")" >> $GITHUB_ENV
42+
43+
- name: Assert PACKAGE_NAME
44+
if: ${{ env.PACKAGE_NAME == 'PLACEHOLDER' }}
45+
run: exit 1 # If we end up here, it means that package was not generated.
46+
47+
- name: Upload npm package to GitHub
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: ${{ env.PACKAGE_NAME }}
51+
path: './packages/react-native-gesture-handler/${{ env.PACKAGE_NAME }}'
52+
53+
- name: Publish npm package
54+
run: npm publish $PACKAGE_NAME --provenance

0 commit comments

Comments
 (0)