version: 2.1 executors: xcode: macos: xcode: "12.5.1" useMacOS: &useMacOS executor: xcode requiresSetup: &requiresSetup requires: - setup tagFilters: &onlyRunOnTags filters: branches: ignore: /.*/ tags: only: /^v([0-9]{1}|[1-9][0-9]+)\.([0-9]{1}|[1-9][0-9]+)\.([0-9]{1}|[1-9][0-9]+)($|[-+][0-9A-Za-z+.-]+$)/ commands: setup: description: Runs before each job and checks out the source code and installs dependencies steps: - checkout - install_gems - persist_to_workspace: root: . paths: - . install_gems: description: Installs ruby gems in the Gemfile steps: - run: name: Set Ruby Version command: echo 'chruby ruby-2.7' >> ~/.bash_profile - run: gem install cocoapods publish_to_github: description: Creates a draft for a release on github steps: - attach_workspace: at: . - run: | STRIPPED_VERSION_NUMBER=${CIRCLE_TAG//.} STRIPPED_VERSION_NUMBER=${STRIPPED_VERSION_NUMBER//v} ghr \ --token ${GITHUB_ACCESS_TOKEN} \ --username ${CIRCLE_PROJECT_USERNAME} \ --repository ${CIRCLE_PROJECT_REPONAME} \ --commitish ${CIRCLE_SHA1} \ --name "Facebook SDK ${CIRCLE_TAG}" \ --body "Consult [Changelog](https://github.com/facebook/facebook-ios-sdk/blob/main/CHANGELOG.md#${STRIPPED_VERSION_NUMBER})" \ --draft \ ${CIRCLE_TAG} jobs: setup: <<: *useMacOS steps: - setup publish-to-github: docker: - image: cibuilds/github:0.13 steps: - publish_to_github workflows: release: jobs: - setup: <<: *onlyRunOnTags - publish-to-github: <<: *onlyRunOnTags