-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
f57d624
commit 26fe70f
Showing
3 changed files
with
74 additions
and
19 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,29 @@ | ||
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 }}" | ||
- 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 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 | ||
run: | | ||
git push origin $CIRCLE_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,34 @@ | ||
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 that should be added to Github' | ||
required: true | ||
type: string | ||
|
||
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