Skip to content

Commit

Permalink
feat: ios and android release workflows (#17)
Browse files Browse the repository at this point in the history
* feat: ios and android release workflows

* Update .github/workflows/android_release.yaml

Co-authored-by: Vansh Gandhi <me@van.sh>

---------

Co-authored-by: Vansh Gandhi <me@van.sh>
  • Loading branch information
JNdhlovu and vanshg authored Dec 20, 2023
1 parent 652401f commit e43340a
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 3 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/android_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Update Android Version

on:
workflow_dispatch:
inputs:
android_release_version:
description: 'SmileID Android Version'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
update-android:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Create Release Branch
run: |
git checkout -b "android-${{ github.event.inputs.android_release_version }}"
git push origin "android-${{ github.event.inputs.android_release_version }}"
- name: Read build.gradle
id: read-file
run: |
sed -i "s/\(SmileId_androidVersion=\).*/\1\"$(echo "${{ github.event.inputs.android_release_version }}" | cut -c 2-)\"/" android/gradle.properties
- name: Commit and Push Changes
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add android/gradle.properties
git commit -m "Update Android SDK version to ${{ github.event.inputs.android_release_version }}"
git push --set-upstream origin "android-${{ github.event.inputs.android_release_version }}"
- name: Create Pull Request
run: |
gh pr create --title "Merge release "android-${{ github.event.inputs.android_release_version }}" into main" --body "This is an automated pull request to update the version." --base main --head "android-${{ github.event.inputs.android_release_version }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/ios_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Update iOS Version

on:
workflow_dispatch:
inputs:
ios_release_version:
description: 'SmileID iOS Version'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
update-ios:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Create Release Branch
run: |
git checkout -b "ios-${{ github.event.inputs.ios_release_version }}"
git push origin "ios-${{ github.event.inputs.ios_release_version }}"
- name: Read build.gradle
id: read-file
run: |
sed -i "s/s.dependency\s*'SmileID'\s*,\s*'[^']*'/s.dependency 'SmileID', '$(echo "${{ github.event.inputs.ios_release_version }}" | cut -c 2-)'/g" react-native-smile-id.podspec
- name: Commit and Push Changes
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add react-native-smile-id.podspec
git commit -m "Update iOS SDK version to ${{ github.event.inputs.ios_release_version }}"
git push --set-upstream origin "ios-${{ github.event.inputs.ios_release_version }}"
- name: Create Pull Request
run: |
gh pr create --title "Merge release "ios-${{ github.event.inputs.ios_release_version }}" into main" --body "This is an automated pull request to update the version." --base main --head "ios-${{ github.event.inputs.ios_release_version }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Add the dependency to your `package.json`:
```json
{
"dependencies": {
"rn-smile-id": "<latest-version>"
"@smile_identity/react-native": "<latest-version>"
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
"ios",
"android"
],
"repository": "https://docs.usesmileid.com/",
"repository": "https://github.com/smileidentity/react-native",
"author": "Smile ID <japhet@smileidentity.com> (https://docs.usesmileid.com/)",
"license": "MIT",
"bugs": {
"url": "https://docs.usesmileid.com//issues"
},
"homepage": "https://docs.usesmileid.com/#readme",
"homepage": "https://docs.usesmileid.com/",
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
Expand Down

0 comments on commit e43340a

Please sign in to comment.