Skip to content

Commit b8a9e3e

Browse files
committed
publish RC rleases tagged as next
1 parent 4826075 commit b8a9e3e

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

templates/react-native/.github/workflows/publish.yml.twig

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
release:
55
types: [published]
66
workflow_dispatch:
7-
87

98
jobs:
109
publish:
@@ -20,13 +19,24 @@ jobs:
2019
node-version: '20.x'
2120
registry-url: 'https://registry.npmjs.org'
2221

22+
# Determine release tag based on the tag name
23+
- name: Determine release tag
24+
id: release_tag
25+
run: |
26+
if [[ "${{ github.ref }}" == *"-rc"* ]]; then
27+
echo "tag=next" >> "$GITHUB_OUTPUT"
28+
else
29+
echo "tag=latest" >> "$GITHUB_OUTPUT"
30+
fi
31+
32+
# Install dependencies (if any) and build your project (if necessary)
2333
- name: Install dependencies and build
2434
run: |
2535
npm install
2636
npm run build
2737

28-
# Publish to NPM
38+
# Publish to NPM with the appropriate tag
2939
- name: Publish
30-
run: npm publish
40+
run: npm publish --tag ${{ steps.release_tag.outputs.tag }}
3141
env:
32-
NODE_AUTH_TOKEN: ${{'{{'}}secrets.NPM_TOKEN{{'}}'}}
42+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 commit comments

Comments
 (0)