Skip to content

Create Release

Create Release #22

Workflow file for this run

name: Create Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
jobs:
create-release:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
- name: Install CocoaPods
run: |
gem install cocoapods cocoapods-trunk
- name: Update Version in PerformanceSuite.podspec
run: |
VERSION_NAME="${{ github.event.inputs.version }}"
if [[ ! "${VERSION_NAME}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "The version ${VERSION_NAME} doesn't match the format X.X.X. Exiting"
exit 0
fi
sed -i '' "s/s.version.*=.*/s.version = '$VERSION_NAME'/g" PerformanceSuite.podspec
- name: Run pod install to update xcode project
run: pod install
- name: Push Changes
run: |
VERSION_NAME="${{ github.event.inputs.version }}"
git add -u
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Update version to $VERSION_NAME"
git tag -f -a $VERSION_NAME HEAD -m "Update version to $VERSION_NAME"
git push --follow-tags
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.version }}
name: ${{ github.event.inputs.version }}
draft: false
prerelease: false
generate_release_notes: true
- name: Push to CocoaPods
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
pod trunk push PerformanceSuite.podspec