Skip to content

Release and Update SDK Version #117

Release and Update SDK Version

Release and Update SDK Version #117

name: Release and Update SDK Version
on:
workflow_dispatch:
inputs:
version:
description: 'The new version to release, ex: 0.12.0'
required: true
type: string
sha:
description: '[Optional] Commit SHA1, branch or tag to build. The latest SHA1 on a given branch is used if no value is provided.'
required: false
type: string
emergency:
type: boolean
description: Ignore main branch requirement (SOC2 compliance)
required: true
jobs:
gh-release:
permissions:
contents: write
uses: ./.github/workflows/release_gh.yaml
with:
version: ${{ inputs.version }}
sha: ${{ inputs.sha }}
secrets: inherit
public-release:
permissions:
id-token: write # required to use OIDC authentication
contents: read
uses: ./.github/workflows/release_public.yaml
with:
version: ${{ inputs.version }}
emergency: ${{ inputs.emergency }}
secrets: inherit
needs: gh-release
capture-ios-release:
uses: ./.github/workflows/release_capture_ios.yaml
with:
version: ${{ inputs.version }}
needs: public-release
secrets: inherit
capture-react-release:
uses: ./.github/workflows/release_capture_react.yaml
with:
version: ${{ inputs.version }}
needs: public-release
secrets: inherit
update-sdk-version:
name: Update SDK version
needs: public-release
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
# Checkout repo to Github Actions runner
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Update the content of platform/shared/.sdk_version'
run: |
echo -n '${{ inputs.version }}' > $file
echo "Updated content of '$file' file:"
cat $file
env:
file: 'platform/shared/.sdk_version'
- name: 'Create Github Token'
id: org-pr-create-token
uses: getsentry/action-github-app-token@d4b5da6c5e37703f8c3b3e43abb5705b46e159cc # v3.0.0
with:
app_id: ${{ secrets.OPEN_CAPTURE_SDK_PRS_APP_ID }}
private_key: ${{ secrets.OPEN_CAPTURE_SDK_PRS_PRIVATE_KEY }}
- name: 'Commiting the changes'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git checkout -b "update-sdk-version-${{ inputs.version }}"
git \
-c author.name="${{ github.actor }}" \
-c author.email="${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" \
-c user.name="GitHub Action" \
-c user.email="noreply@github.com" \
commit \
-am 'Update SDK version to ${{ inputs.version }}'
git push origin "update-sdk-version-${{ inputs.version }}"
- name: 'Create Pull Request'
env:
GITHUB_TOKEN: ${{ steps.org-pr-create-token.outputs.token }}
run: |
# Create PR and capture the URL
PR_URL=$(gh pr create --fill --head update-sdk-version-${{ inputs.version }})
echo "PR created at $PR_URL"