-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add version check on release branches
- Loading branch information
1 parent
4b1fe41
commit a1211f7
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Validate release | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'releases/**' | ||
|
||
jobs: | ||
versioncheck: | ||
runs-on: macos-latest | ||
name: Validate Versions | ||
steps: | ||
- name: Compare Podspec Version | ||
uses: actions/checkout@v2 | ||
- name: Run Version Check Script | ||
run: ./scripts/version-check.sh | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
readonly COCOAPOD_SPEC=Mux-Upload-SDK.podspec | ||
|
||
cocoapod_spec_version=$(grep -Eo '\b[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+)?(\+[0-9A-Za-z-]+)?\b' $COCOAPOD_SPEC | awk 'NR==1') | ||
|
||
echo "Detected Cocoapod Spec Version: ${cocoapod_spec_version}" | ||
|
||
release_version=$(git branch --show-current | sed -E 's/.*v([0-9]+\.[0-9]+\.[0-9]+).*/\1/') | ||
|
||
echo "Inferred Release Version: ${release_version}" | ||
|
||
if [ "${cocoapod_spec_version}" == "${release_version}" ]; then | ||
echo "Versions match" | ||
else | ||
echo "Versions do not match, please update the cocoapod spec to ${release_version}" | ||
exit 1 | ||
fi | ||
|
||
|
||
|