Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change/publish and tag in same step #65

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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