# How to update COCOAPODS_TRUNK_TOKEN
#
# 1) Register the email with:
#      pod trunk register <email> --description='Deploy to CocoaPods GitHub Action'
# 
# 2) Click the link on the confirmation email.
#
# 3) Extract the value from the "password <COCOAPODS_TRUNK_TOKEN>" like output of the following command:
#      grep -A2 'trunk.cocoapods.org' ~/.netrc | grep password
#
# 4) IMPORTANT - Register again to locally use a separate token:
#      pod trunk register <email> --description='<Machine description>'
#

name: Deploy to CocoaPods

on:
  release:
    types: [created]

jobs:
  build:

    runs-on: macos-latest

    steps:
    - uses: actions/checkout@v2

    - name: Update Podspec version
      run: fastlane run version_bump_podspec path:ImmutableGraph.podspec version_number:${{ github.ref }}
      
    - name: switching from HTTPS to SSH
      run: git remote set-url origin ${{ secrets.ssh }}

    - name: check for changes
      run: git status

#     - name: Pod infos
#       run: pod trunk info ImmutableGraph

#     - name: Validation
#       run: pod lib lint ImmutableGraph.podspec

#     - name: Deploy
#       run: pod trunk push ImmutableGraph.podspec
#       env:
#         COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

# How to update COCOAPODS_TRUNK_TOKEN
#
# 1) Register the email with:
#      pod trunk register <email> --description='Deploy to CocoaPods GitHub Action'
# 
# 2) Click the link on the confirmation email.
#
# 3) Extract the value from the "password <COCOAPODS_TRUNK_TOKEN>" like output of the following command:
#      grep -A2 'trunk.cocoapods.org' ~/.netrc | grep password
#
# 4) IMPORTANT - Register again to locally use a separate token:
#      pod trunk register <email> --description='<Machine description>'
#

name: Deploy to CocoaPods

on:
  release:
    types: [created]

jobs:
  build:

    runs-on: macos-latest

    steps:
    - uses: actions/checkout@v2

    - name: Update Podspec version
      run: fastlane run version_bump_podspec path:ImmutableGraph.podspec version_number:${${{ github.ref }}#"refs/tags/"}
      
#     - name: switching from HTTPS to SSH
#       run: git remote set-url origin ${{ secrets.ssh }}

    - name: check for changes
      run: git status

#     - name: Pod infos
#       run: pod trunk info ImmutableGraph

#     - name: Validation
#       run: pod lib lint ImmutableGraph.podspec

#     - name: Deploy
#       run: pod trunk push ImmutableGraph.podspec
#       env:
#         COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

Deploy to CocoaPods on release created test
Deploy to CocoaPods on release created test