Merge pull request #17 from razorpay/v2.0.10 #12
This file contains 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: Cocoapod Deployment | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
tag-release: | |
runs-on: ubuntu-latest # nosemgrep : non-self-hosted-runner | |
steps: | |
- name: Check out razorpay-ios repository code | |
uses: actions/checkout@v2 | |
- name: Set permission | |
run: exec chmod +x ./.github/scripts/read-podspec-version.sh | |
- name: Read version | |
id: read-podspec-version | |
run: | | |
version=$(exec ./.github/scripts/read-podspec-version.sh) | |
echo ::set-output name=pod-version::$version | |
- name: List Artifacts | |
uses: actions/github-script@v6 | |
id: list-artifacts | |
with: | |
script: | | |
return github.rest.actions.listArtifactsForRepo({ | |
owner: context.repo.owner, | |
repo: context.repo.repo | |
}) | |
- name: Download Artifact | |
uses: dawidd6/action-download-artifact@v2 | |
env: | |
ARTIFACT_ID: ${{ fromJson(steps.list-artifacts.outputs.result).data.artifacts[0].workflow_run.id }} | |
with: | |
run_id: ${{ env.ARTIFACT_ID }} | |
workflow: deploy-custom-checkout.yml | |
path: ~/Desktop | |
- name: Tag release | |
id: create-release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} | |
POD_VERSION: ${{ steps.read-podspec-version.outputs.pod-version }} | |
ARTIFACT_NAME: ${{ fromJson(steps.list-artifacts.outputs.result).data.artifacts[0].name }} | |
with: | |
tag_name: "${{ env.POD_VERSION }}" | |
release_name: "v_${{ env.POD_VERSION }}" | |
generateReleaseNotes: true | |
draft: false | |
prerelease: false | |
- name: Zip Release Folder | |
uses: vimtor/action-zip@v1 | |
env: | |
ARTIFACT_NAME: ${{ fromJson(steps.list-artifacts.outputs.result).data.artifacts[0].name }} | |
with: | |
files: ~/Desktop/${{env.ARTIFACT_NAME}} | |
recursive: false | |
dest: ${{env.ARTIFACT_NAME}}.zip | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} | |
ARTIFACT_NAME: ${{ fromJson(steps.list-artifacts.outputs.result).data.artifacts[0].name }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: "${{ github.workspace }}/${{env.ARTIFACT_NAME}}.zip" | |
asset_name: ${{env.ARTIFACT_NAME}} | |
asset_content_type: application/zip | |
- run: | | |
echo "Upload URL ===> ${{ steps.create-release.outputs.upload_url }}" | |
cocoapod-release: | |
needs: tag-release | |
runs-on: macOS-latest # nosemgrep : non-self-hosted-runner | |
steps: | |
- name: Check out razorpay-customui-pod repository code | |
uses: actions/checkout@v2 | |
- name: Publish to cocoapods | |
env: | |
COCOAPOD_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | |
run: | | |
pod lib lint razorpay-customui-pod.podspec |