Skip to content

Commit

Permalink
change/publish and tag in same step (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
blakef committed Oct 2, 2024
1 parent 8fbe281 commit a10830c
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,21 @@ jobs:
"${GIT[@]}" push
"${GIT[@]}" tag $VERSION
"${GIT[@]}" push --tags
- name: Publish NPM
run: npm publish
- name: Publish on NPM (with tag if needed)
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Set NPM tags
run: |
NPM=(echo npm)
args=(--dry-run)
if [ "${{ inputs.dry_run }}" = "false" ]; then
NPM=(npm)
args=()
fi
IS_LATEST_ON_NPM="${{ inputs.is_latest_on_npm }}"
if [[ "$IS_LATEST_ON_NPM" == "true" ]]; then
"${NPM[@]}" dist-tag add @react-native-community/template@$VERSION latest
fi
if [[ "$VERSION" == *"rc"* ]]; then
"${NPM[@]}" dist-tag add @react-native-community/template@$VERSION next
fi
if [[ "$GITHUB_REF_NAME" == *"-stable" ]]; then
"${NPM[@]}" dist-tag add @react-native-community/template@$VERSION $GITHUB_REF_NAME
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
npm publish --tag latest "${args[@]}"
elif [[ "$VERSION" == *"rc"* ]]; then
npm publish --tag next "${args[@]}"
elif [[ "$GITHUB_REF_NAME" == *"-stable" ]]; then
npm publish --tag "$GITHUB_REF_NAME" "${args[@]}"
else
npm publish "${args[@]}"
if

0 comments on commit a10830c

Please sign in to comment.