-
Notifications
You must be signed in to change notification settings - Fork 18
93 lines (82 loc) · 3.29 KB
/
release-to-cocoapods.yml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
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-standard-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-ios repository code
uses: actions/checkout@v2
- name: Publish to cocoapods
run: |
set -eo pipefail
pod lib lint --allow-warnings
pod trunk push razorpay-pod.podspec --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}