Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 19 additions & 41 deletions .github/workflows/bump-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ on:
jobs:
Bump-And-Release:
runs-on: macos-14
outputs:
previousVersion: ${{ steps.store_previous_version.outputs.previousVersion }}
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.2.0'
- name: Log stacks
# language=bash
run: |
echo "Log macOS version"
sw_vers
Expand All @@ -45,32 +44,42 @@ jobs:
token: ${{ secrets.ACCESS_TOKEN }}
- id: store_previous_version
name: Store previous version value
# language=bash
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 and push the changes made to the version.json file
- name: Commit the version.json file
if: inputs.version != ''
# language=bash
run: |
git add version.json
git commit -m "update version.json"
git push
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 != '' && inputs.dryRun == false
if: inputs.version != ''
run: sh update_changelog.sh -v ${{ inputs.version }}
- name: Commit and push the changes made to the CHANGELOG.md file
if: inputs.version != '' && inputs.dryRun == false
- name: Commit CHANGELOG.md file
if: inputs.version != ''
run: sh commit_changelog.sh
- name: Add and push new git tag
- name: Add new git tag
if: inputs.version != ''
# language=bash
run: |
git tag ${{ inputs.version }}
- name: Push changes
if: inputs.version != '' && inputs.version != steps.store_previous_version.outputs.previousVersion && inputs.dryRun == false
# language=bash
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 }}
# language=bash
run: |
# make the command
command="${{ (inputs.dryRun == true && 'spec lint') || 'trunk push' }}"
Expand Down Expand Up @@ -117,34 +126,3 @@ jobs:
git checkout "$connector"
fi
done
Cleanup:
needs: Bump-And-Release
if: (inputs.dryRun == true && inputs.version != '') && (success() || failure())
runs-on: macos-14
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.2.0'
- name: Check out repository code
uses: actions/checkout@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Update to latest
run: |
git fetch --all
git pull
- name: Remove and unpublish git tag
run: git push --delete origin refs/tags/${{ inputs.version }}
- name: Update(Revert) the version.json file back to the previous version
env:
PREVIOUS_VERSION: ${{ needs.Bump-And-Release.outputs.previousVersion }}
run: |
sh update_version_json.sh -v $PREVIOUS_VERSION
- name: Commit and push the changes made to the version.json file
run: |
diff=$(git diff version.json)
if [[ $diff != '' ]]; then
git add version.json
git commit -m "update version.json"
git push
fi