{"id":13533482,"url":"https://github.com/michaelhenry/deploy-to-cocoapods-github-action","last_synced_at":"2025-04-13T06:32:06.913Z","repository":{"id":44952428,"uuid":"210092705","full_name":"michaelhenry/deploy-to-cocoapods-github-action","owner":"michaelhenry","description":"Github action for deploying to Cocoapods.org","archived":false,"fork":false,"pushed_at":"2022-01-16T13:26:24.000Z","size":180,"stargazers_count":37,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T04:01:36.142Z","etag":null,"topics":["automation","ci","cocoapods","github","github-actions","pod"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelhenry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-22T04:56:58.000Z","updated_at":"2024-09-18T19:29:51.000Z","dependencies_parsed_at":"2023-01-11T17:22:46.114Z","dependency_job_id":null,"html_url":"https://github.com/michaelhenry/deploy-to-cocoapods-github-action","commit_stats":{"total_commits":25,"total_committers":2,"mean_commits":12.5,"dds":0.07999999999999996,"last_synced_commit":"e2d98a21675c4a6eebfc72041cf013fd41590278"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelhenry%2Fdeploy-to-cocoapods-github-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelhenry%2Fdeploy-to-cocoapods-github-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelhenry%2Fdeploy-to-cocoapods-github-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelhenry%2Fdeploy-to-cocoapods-github-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelhenry","download_url":"https://codeload.github.com/michaelhenry/deploy-to-cocoapods-github-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248537187,"owners_count":21120711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","ci","cocoapods","github","github-actions","pod"],"created_at":"2024-08-01T07:01:20.311Z","updated_at":"2025-04-13T06:32:06.417Z","avatar_url":"https://github.com/michaelhenry.png","language":"JavaScript","readme":"# Deploy to cocoapods\n\nUsing this GitHub Action, you can deploy automatically your pod library to [Cocoapods.org](https://cocoapods.org)\n\n## Requirements\n\n- Must have register to cocoapod trunk. Please refer to [Getting setup with Trunk](https://guides.cocoapods.org/making/getting-setup-with-trunk.html) on how to register.\n- Get your `trunk token` by using `pod trunk me --verbose` from your command line.\n\n  Example response:\n\n  ```bash\n  opening connection to trunk.cocoapods.org:443...\n  opened\n  starting SSL for trunk.cocoapods.org:443...\n  SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256\n  \u003c- \"GET /api/v1/sessions HTTP/1.1\\r\\nContent-Type: application/json; charset=utf-8\\r\\nAccept: application/json; charset=utf-8\\r\\nUser-Agent: CocoaPods/1.7.4\\r\\nAuthorization: Token XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\\r\\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\\r\\nHost: trunk.cocoapods.org\\r\\n\\r\\n\"\n  -\u003e \"HTTP/1.1 200 OK\\r\\n\"\n  -\u003e \"Date: Sun, 22 Sep 2019 05:11:46 GMT\\r\\n\"\n  -\u003e \"Connection: keep-alive\\r\\n\"\n  -\u003e \"Strict-Transport-Security: max-age=31536000\\r\\n\"\n  -\u003e \"Content-Type: application/json\\r\\n\"\n  -\u003e \"Content-Length: 1491\\r\\n\"\n  -\u003e \"X-Content-Type-Options: nosniff\\r\\n\"\n  -\u003e \"Server: thin 1.6.2 codename Doc Brown\\r\\n\"\n  -\u003e \"Via: 1.1 vegur\\r\\n\"\n  -\u003e \"\\r\\n\"\n  ```\n  Please get only the `XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX` as your `trunk token`.\n\n- register the your `trunk token` as [Secrets](https://help.github.com/en/articles/virtual-environments-for-github-actions#creating-and-using-secrets-encrypted-variables) and named it as `COCOAPODS_TRUNK_TOKEN`.\n\n## Usage\n\nThe workflow, usually declared in `.github/workflows/deploy_to_cocoapods.yml`, looks like:\n\n```yml\nname: deploy_to_cocoapods\n\non:\n  push:\n    tags:\n      - '*'\n\njobs:\n  build:\n\n    runs-on: macOS-latest\n\n    steps:\n    - uses: actions/checkout@v1\n    \n    - name: Install Cocoapods\n      run: gem install cocoapods\n    \n    # shortcut version\n    - uses: michaelhenry/deploy-to-cocoapods-github-action@1.0.10\n      env:\n        COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}\n```\n\nOR\n\n\n```yml\nname: deploy_to_cocoapods\n\non:\n  push:\n    tags:\n      - '*'\n\njobs:\n  build:\n\n    runs-on: macOS-latest\n\n    steps:\n    - uses: actions/checkout@v1\n    \n    - name: Install Cocoapods\n      run: gem install cocoapods\n      \n    - name: Deploy to Cocoapods\n      run: |\n        set -eo pipefail\n        pod lib lint --allow-warnings\n        pod trunk push --allow-warnings\n      env:\n        COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}\n```\n\n## Example\n\nAn actual example can be found on this Repository: [Autobot](https://github.com/michaelhenry/AutoBot/blob/master/.github/workflows/deploy_to_cocoapods.yml).\n\n## Recommendations\n\nI also do recommend to automatically sync your library versioning with your `git tags or releases`. for example this  `*.spec` file, I provided an environment variable for `LIB_VERSION` to use as the actual version, else it will goes to fallback version which is `1.0`\n\n```ruby\nPod::Spec.new do |s|\n  s.name             = 'AutoBot'\n  s.version          = ENV['LIB_VERSION'] || '1.0' #fallback to major version\n  s.summary          = 'UITestCases generator and executor for iOS Application.'\n...\nend\n```\n\non the github action, we have to update the step `Deploy to Cocoapods` from\n\n```yml\n...\n    - name: Deploy to Cocoapods\n      run: |\n        set -eo pipefail\n        pod lib lint --allow-warnings\n        pod trunk push --allow-warnings\n      env:\n        COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}\n```\n\nto \n\n```yml\n...\n    - name: Deploy to Cocoapods\n      run: |\n        set -eo pipefail\n        export LIB_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)\n        pod lib lint --allow-warnings\n        pod trunk push --allow-warnings\n      env:\n        COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}\n```\n\nand that's all.\n\n\n## Cheers!\n\nIf you found some problems or encountered some troubles, please don't hessitate to let me know. I'm happy to help you!\n\n## LICENSE\n\nMIT\n","funding_links":[],"categories":["Community Resources"],"sub_categories":["Deployment"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelhenry%2Fdeploy-to-cocoapods-github-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelhenry%2Fdeploy-to-cocoapods-github-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelhenry%2Fdeploy-to-cocoapods-github-action/lists"}