Skip to content

Commit

Permalink
[RN][GHA] Migrate the Prepare Release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cipolleschi committed Jun 7, 2024
1 parent f57d624 commit 4f8e482
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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
# TODO: remove this
pull_request:

jobs:
prepare_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Exist if not on stable branches
id: check-stable-branch
run: |
BRANCH="$(git branch --show-current)"
PATTERN='^0\.[0-9]+-stable$'
if [[ $BRANCH =~ $PATTERN ]]; then
echo "ON_STABLE_BRANCH=true" >> "$GITHUB_ENV"
fi
- name: Yarn Install
if: ${{ steps.check-stable-branch.outputs.ON_STABLE_BRANCH == true }}
run: yarn install --non-interactive
- name: Versioning workspace packages
if: ${{ steps.check-stable-branch.outputs.ON_STABLE_BRANCH == true }}
run: |
node scripts/releases/set-version "${{ inputs.version }}"
- name: Creating Release commit
if: ${{ steps.check-stable-branch.outputs.ON_STABLE_BRANCH == true }}
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
if: ${{ steps.check-stable-branch.outputs.ON_STABLE_BRANCH == true && inputs.tag == 'latest' }}
run: |
git tag -d "latest"
git push origin :latest
git tag -a "latest" -m "latest"
# - name: Pushing release commit
# run: |
# git push origin $CIRCLE_BRANCH --follow-tags

0 comments on commit 4f8e482

Please sign in to comment.