-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RN][GHA] Migrate the Prepare Release workflow
- Loading branch information
1 parent
6937c70
commit feee69d
Showing
3 changed files
with
86 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: prepare_release | ||
description: Prepare React Native release | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Yarn install | ||
shell: bash | ||
run: yarn install --non-interactive | ||
- name: Versioning workspace packages | ||
shell: bash | ||
run: | | ||
node scripts/releases/set-version "${{ inputs.version }}" --skip-react-native-version | ||
- name: Versioning react-native package | ||
shell: bash | ||
run: | | ||
node scripts/releases/set-rn-version.js -v "<< parameters.version >>" --build-type "release" | ||
- name: Creating release commit | ||
shell: bash | ||
run: | | ||
git commit -a -m "Release ${{ inputs.version }}" -m "#publish-packages-to-npm&${{ inputs.tag }}" | ||
git tag -a "v${{ inputs.version }}" -m "v${{ inputs.version }}" | ||
GIT_PAGER=cat git show HEAD | ||
- name: Update "latest" tag if needed | ||
shell: bash | ||
if: ${{ inputs.tag == 'latest' }} | ||
run: | | ||
git tag -d "latest" | ||
git push origin :latest | ||
git tag -a "latest" -m "latest" | ||
- name: Pushing release commit | ||
shell: bash | ||
if: ${{ inputs.dry_run == false }} | ||
run: | | ||
CURR_BRANCH="$(git branch --show-current)" | ||
git push origin "$CURR_BRANCH" --follow-tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Prepare Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'The version of React Native we want to release' | ||
required: true | ||
type: string | ||
tag: | ||
description: 'The tag name that will be associated with the published npm packages. A tag of "latest" will also be written as a Git tag.' | ||
required: true | ||
type: string | ||
dry_run: | ||
description: 'Whether the job should be executed in dry-run mode or not' | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
prepare_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Check if on stable branch | ||
id: check_stable_branch | ||
run: | | ||
BRANCH="$(git branch --show-current)" | ||
PATTERN='^0\.[0-9]+-stable$' | ||
if [[ $BRANCH =~ $PATTERN ]]; then | ||
echo "On a stable branch" | ||
echo "ON_STABLE_BRANCH=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Print output | ||
run: echo "ON_STABLE_BRANCH ${{steps.check_stable_branch.outputs.ON_STABLE_BRANCH}}" | ||
- name: Execute Prepare Release | ||
if: ${{ steps.check_stable_branch.outputs.ON_STABLE_BRANCH }} | ||
uses: ./.github/actions/prepare_release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters