Prepare dev branch for next release #13
This file contains hidden or 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
| name: Prepare dev branch for next release | |
| on: | |
| workflow_run: | |
| workflows: ['Release Package'] | |
| types: [completed] | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-pods: | |
| name: Update Podfile.lock after release | |
| runs-on: macos-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' && startsWith(github.event.workflow_run.head_commit.message, 'release:') }} | |
| env: | |
| XCODE_VERSION: latest-stable | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5.0.0 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| ref: main | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Install CocoaPods | |
| working-directory: example | |
| run: yarn ios:pods | |
| - name: Commit updated Podfile.lock | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add example/ios/Podfile.lock | |
| if git diff --cached --quiet; then | |
| echo "No Podfile.lock changes." | |
| exit 0 | |
| fi | |
| git commit -m "chore(example): update Podfile.lock after release" | |
| git push origin main | |
| sync-dev: | |
| name: Sync dev with main | |
| runs-on: ubuntu-latest | |
| needs: update-pods | |
| if: ${{ always() && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' && startsWith(github.event.workflow_run.head_commit.message, 'release:') }} | |
| steps: | |
| - name: Checkout dev | |
| uses: actions/checkout@v5.0.0 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| ref: dev | |
| - name: Reset dev to main | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git fetch origin main dev | |
| git checkout dev | |
| git reset --hard origin/main | |
| git push --force-with-lease origin dev |