Bumping version to 10.10.0 and validating All #229
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Bump and release | |
| run-name: ${{ (inputs.version == '' && 'Not bumping version') || format('Bumping version to {0}', inputs.version) }} and ${{ (inputs.dryRun == true && 'validating') || 'releasing' }} ${{ inputs.connectors }} | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to bump and tag. If unset, then skips version bump and tag.' | |
| required: false | |
| type: string | |
| dryRun: | |
| description: 'Dry run to only validate without release.' | |
| required: true | |
| default: true | |
| type: boolean | |
| connectors: | |
| description: 'Choose the Connector(s)' | |
| required: true | |
| type: choice | |
| default: 'All' | |
| options: | |
| - All | |
| - Utilities | |
| - Comscore | |
| - Conviva | |
| - SideloadedSubtitle | |
| - Uplynk | |
| jobs: | |
| Bump-And-Release: | |
| runs-on: macos-14 | |
| steps: | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: '16.2.0' | |
| - name: Log stacks | |
| run: | | |
| echo "Log macOS version" | |
| sw_vers | |
| echo "Log Xcode version" | |
| xcodebuild -version | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.ACCESS_TOKEN }} | |
| - id: store_previous_version | |
| name: Store previous version value | |
| run: | | |
| previousVersion=$(ruby -r "./THEOplayer-Connector-Version.rb" -e "print_theoplayer_connector_version") | |
| echo "previousVersion=$previousVersion" >> "$GITHUB_OUTPUT" | |
| - name: Update the version.json file | |
| if: inputs.version != '' | |
| run: sh update_version_json.sh -v ${{ inputs.version }} | |
| - name: Commit the version.json file | |
| if: inputs.version != '' | |
| run: | | |
| if ! git diff --quiet version.json; then | |
| git add version.json | |
| git commit -m "update version.json" | |
| fi | |
| - name: Update CHANGELOG.md file | |
| if: inputs.version != '' | |
| run: sh update_changelog.sh -v ${{ inputs.version }} | |
| - name: Commit CHANGELOG.md file | |
| if: inputs.version != '' | |
| run: sh commit_changelog.sh | |
| - name: Add new git tag | |
| if: inputs.version != '' | |
| run: | | |
| git tag ${{ inputs.version }} | |
| - name: Push changes | |
| if: inputs.version != '' && inputs.version != steps.store_previous_version.outputs.previousVersion && inputs.dryRun == false | |
| run: | | |
| git push origin | |
| git push origin ${{ inputs.version }} | |
| - name: ${{ (inputs.dryRun == true && 'Validate') || 'Release' }} on Cocoapods | |
| env: | |
| COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | |
| run: | | |
| # make the command | |
| command="${{ (inputs.dryRun == true && 'spec lint') || 'trunk push' }}" | |
| # make the list of connectors | |
| prefix="THEOplayer-Connector" | |
| connectors=() | |
| if [ "${{ inputs.connectors }}" == "All" ]; then | |
| files=(*) | |
| for file in ${files[*]} | |
| do | |
| if [[ $file == *.podspec ]]; then | |
| # we add the Utilities later at index 0 | |
| if [[ $file == *Utilities.podspec ]]; then | |
| continue | |
| fi | |
| # blacklisted podspecs | |
| if [[ $file == *VerizonMedia.podspec || $file == *Nielsen.podspec || $file == *Yospace.podspec ]]; then | |
| continue | |
| fi | |
| # Conviva validation depends on Utilities being available, which does not get published in a dry run | |
| # => skip Conviva if dry run | |
| if [[ $file == *Conviva.podspec && ${{ inputs.dryRun }} == true ]]; then | |
| continue | |
| fi | |
| connectors+=("$file") | |
| fi | |
| done | |
| connectors=("$prefix-Utilities.podspec" "${connectors[@]}") | |
| else | |
| connectors+=("$prefix-${{ inputs.connectors }}.podspec") | |
| fi | |
| for connector in ${connectors[*]} | |
| do | |
| pod repo update | |
| cmd="pod $command $connector --verbose --allow-warnings" | |
| if [ ${{ inputs.dryRun }} == false ]; then | |
| cmd="$cmd --synchronous" | |
| else | |
| branch=$(git rev-parse --abbrev-ref HEAD) | |
| sed -i '' "s|:tag => [^,}]*|:branch => \"$branch\"|g" "$connector" | |
| fi | |
| $cmd | |
| if [ ${{ inputs.dryRun }} == true ]; then | |
| git checkout "$connector" | |
| fi | |
| done |