Skip to content

Commit

Permalink
ci: update release action, move development to public repo
Browse files Browse the repository at this point in the history
  • Loading branch information
einsteinx2 committed Jan 31, 2022
1 parent c827eae commit a4ade9b
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions .github/workflows/sdk-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ on:
default: "true"

jobs:
# SDK release is done from public master branch.
confirm-public-repo-master-branch:
name: "Confirm release is run from public/master branch"
# SDK release is done from public main branch.
confirm-public-repo-main-branch:
name: "Confirm release is run from public/main branch"
uses: mParticle/mparticle-workflows/.github/workflows/sdk-release-repo-branch-check.yml@stable

create-release-branch:
name: Create release branch
runs-on: macOS-latest
needs: confirm-public-repo-master-branch
needs: confirm-public-repo-main-branch
steps:
- name: Checkout internal development branch
- name: Checkout public development branch
uses: actions/checkout@v2
with:
repository: mParticle/mparticle-apple-sdk-internal
repository: ${{ github.repository }}
token: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
ref: development

- name: Create and push release branch to internal repository
- name: Create and push release branch to public repository
run: |
git checkout -b release/${{ github.run_number }}
git push origin release/${{ github.run_number }}
Expand Down Expand Up @@ -54,18 +54,17 @@ jobs:
git config user.email "developers@mparticle.com"
git config user.name "mParticle Automation"
- name: Checkout public master branch
- name: Checkout public main branch
uses: actions/checkout@v2
with:
fetch-depth: 0
repository: ${{ github.repository }}
token: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
ref: master
ref: main

- name: Merge internal release branch into public master branch
- name: Merge public release branch into public main branch
run: |
git remote add internal https://${{ secrets.MP_SEMANTIC_RELEASE_BOT }}@github.com/mParticle/mparticle-apple-sdk-internal.git
git pull internal release/${{ github.run_number }}
git pull origin release/${{ github.run_number }}
- name: Release --dry-run
if: ${{ github.event.inputs.dryRun == 'true'}}
Expand Down Expand Up @@ -101,12 +100,12 @@ jobs:
-p @semantic-release/exec@5 \
semantic-release
- name: Push automated release commits to internal release branch
- name: Push automated release commits to public release branch
if: ${{ github.event.inputs.dryRun == 'false' }}
run: |
ls
git status
git push internal HEAD:release/${{ github.run_number }}
git push origin HEAD:release/${{ github.run_number }}
- name: Release to CocoaPods
if: ${{ github.event.inputs.dryRun == 'false'}}
Expand All @@ -115,36 +114,37 @@ jobs:
pod trunk push --allow-warnings
sync-repository:
name: Sync internal and public repositories
name: Finalize release and sync internal and public repositories
needs: release
runs-on: macOS-latest
steps:
- name: Checkout public master branch
- name: Checkout public main branch
uses: actions/checkout@v2
with:
fetch-depth: 0
repository: ${{ github.repository }}
token: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
ref: master
ref: main

- name: Merge internal release branch into public master branch
- name: Merge public release branch into public main branch
if: ${{ github.event.inputs.dryRun == 'false' }}
run: |
git remote add internal https://${{ secrets.MP_SEMANTIC_RELEASE_BOT }}@github.com/mParticle/mparticle-apple-sdk-internal.git
git pull internal release/${{ github.run_number }}
git pull origin release/${{ github.run_number }}
- name: Push release commits to public master branch
- name: Push release commits to public main and development branches
if: ${{ github.event.inputs.dryRun == 'false'}}
run: |
git push origin HEAD:master
git push origin HEAD:main
git push origin HEAD:development
- name: Push release commits to internal master and development branches
- name: Push release commits to internal main and development branches
if: ${{ github.event.inputs.dryRun == 'false' }}
run: |
git remote add internal https://${{ secrets.MP_SEMANTIC_RELEASE_BOT }}@github.com/mParticle/mparticle-apple-sdk-internal.git
git push internal HEAD:main
git push internal HEAD:development
git push internal HEAD:master
- name: Delete internal release branch
- name: Delete public release branch
if: ${{ github.event.inputs.dryRun == 'false' }}
run: |
git push --delete internal release/${{ github.run_number }}
git push --delete origin release/${{ github.run_number }}

0 comments on commit a4ade9b

Please sign in to comment.