forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate the Prepare Release workflow (facebook#44833)
Summary: This change migrates the prepare_release workflow from CCI to GHA ## Changelog: [Internal] - Migrate from CCI to GHA Pull Request resolved: facebook#44833 Test Plan: Test on GHA Reviewed By: huntie Differential Revision: D58289050 Pulled By: cipolleschi fbshipit-source-id: 134fc7ffb66a18eec1187e14500daec2828cae61
- Loading branch information
1 parent
fdb2427
commit 7ce5e56
Showing
3 changed files
with
86 additions
and
15 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/checkout@v4.1.1 | ||
- 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