-
Notifications
You must be signed in to change notification settings - Fork 10
80 lines (74 loc) · 2.66 KB
/
android-kit-release.yml
File metadata and controls
80 lines (74 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: "Android Kit Release SDK"
on:
workflow_call:
inputs:
dryRun:
description: "Do a dry run to preview instead of a real release [true/false]"
required: false
default: "false"
type: string
jobs:
# 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@main
create-release-branch:
name: "Create Release Branch"
runs-on: ubuntu-latest
needs: confirm-public-repo-main-branch
env:
GITHUB_TOKEN: ${{ secrets.MP_INTEGRATIONS_SEMANTIC_RELEASE_BOT }}
GIT_AUTHOR_NAME: mparticle-automation
GIT_AUTHOR_EMAIL: developers@mparticle.com
GIT_COMMITTER_NAME: mparticle-automation
GIT_COMMITTER_EMAIL: developers@mparticle.com
steps:
- name: "Checkout main branch"
uses: actions/checkout@v6
with:
token: ${{ secrets.MP_INTEGRATIONS_SEMANTIC_RELEASE_BOT }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: main
- name: "Import GPG Key"
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: "Create and push release branch"
run: |
git checkout -b release/${{ github.run_number }}
git push origin release/${{ github.run_number }}
regression-check:
needs: create-release-branch
name: "Run regression"
uses: mParticle/mparticle-workflows/.github/workflows/android-kit-push.yml@main
with:
dryRun: ${{ inputs.dryRun }}
branch_name: release/${{ github.run_number }}
secrets: inherit
sync-repository:
name: "Sync Repository"
needs: regression-check
runs-on: ubuntu-latest
steps:
- name: "Checkout main branch"
uses: actions/checkout@v6
with:
fetch-depth: 0
repository: ${{ github.repository }}
token: ${{ secrets.MP_INTEGRATIONS_SEMANTIC_RELEASE_BOT }}
ref: main
- name: "Merge release branch into main branch"
if: ${{ inputs.dryRun == 'false' }}
run: |
git pull origin release/${{ github.run_number }}
- name: "Push release commits to main branch"
if: ${{ inputs.dryRun == 'false' }}
run: |
git push origin HEAD:main
- name: "Delete release branch"
if: ${{ inputs.dryRun == 'false' }}
run: |
git push --delete origin release/${{ github.run_number }}