Release AEPTestUtils #2
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
name: Release AEPTestUtils | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Release version for AEPTestUtils. Example: 3.0.2 (workflow will create tag `testutils-3.0.2`)' | |
required: true | |
jobs: | |
release-testutils: | |
runs-on: macos-latest | |
steps: | |
- name: Validate Version Format | |
id: validate_version | |
run: | | |
if [[ ! "${{ github.event.inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
echo "Error: Version format is invalid. Expected format: x.y.z" | |
exit 1 | |
fi | |
echo "Version format is valid." | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
ref: main | |
- name: Install XcodeGen | |
run: brew install xcodegen | |
- name: Run Test Podspec Script | |
run: make test-podspec-testutils | |
- name: Check Podspec Version | |
id: check_version | |
run: | | |
set -eo pipefail | |
podspec_version=$(grep -E 's.version\s*=\s*".*"' AEPTestUtils.podspec | sed -E 's/[^0-9]*([0-9]+\.[0-9]+\.[0-9]+).*/\1/') | |
echo "Podspec version: $podspec_version" | |
if [ "$podspec_version" != "${{ github.event.inputs.version }}" ]; then | |
echo "Error: Version mismatch. Expected ${{ github.event.inputs.version }}, but found $podspec_version." | |
echo "You can update the AEPTestUtils version by running the 'Update AEPTestUtils Version' workflow." | |
exit 1 | |
fi | |
echo "Podspec version matches the input version." | |
- name: Create Git Tag | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
tag_name="testutils-${{ github.event.inputs.version }}" | |
git tag -a "$tag_name" -m "Release $tag_name" | |
git push origin "$tag_name" |