Skip to content

Commit

Permalink
Merge pull request #2195 from CruGlobal/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
levieggertcru authored Jul 10, 2024
2 parents 065d16b + 1a4ae71 commit b31e4f2
Showing 1 changed file with 98 additions and 159 deletions.
257 changes: 98 additions & 159 deletions .github/workflows/create-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,10 @@ jobs:
else
echo echo "value=false" >> "$GITHUB_OUTPUT"
fi
increment_version:
name: Fastlane Increment Version
runs-on: macos-14
needs: [ version_increment_is_bump ]
if: ${{ needs.version_increment_is_bump.outputs.isBump == 'true' || inputs.versionIncrementType == 'manual' }}
steps:
- name: Increment Version
run: |
if [ ${{ needs.version_increment_is_bump.outputs.isBump }} == 'true' ]; then
bundle exec fastlane cru_shared_lane_increment_version_number bump_type:${{ inputs.versionIncrementType }}
elif [ ${{ inputs.versionIncrementType }} == 'manual' ]; then
bundle exec fastlane cru_shared_lane_increment_version_number version_number:${{ inputs.manualVersionNumber }}
else
echo "No Version"
fi
current_version:
name: Store Current Version
runs-on: ubuntu-latest
needs: [ increment_version ]
if: github.event_name == 'workflow_dispatch'
outputs:
version: ${{ steps.version.outputs.version }}
Expand All @@ -77,7 +60,8 @@ jobs:
uses: actions/checkout@v4
- name: Set Version Output
id: version
run: grep -m 1 MARKETING_VERSION godtools.xcodeproj/project.pbxproj | sed 's/s.//' | sed "s/'//g" | sed 's/ //g' | sed 's/;//g' | sed 's/MARKETING_VERSION=//g' >> $GITHUB_OUTPUT
run: |
echo "version=$(grep -m 1 MARKETING_VERSION godtools.xcodeproj/project.pbxproj | sed 's/;//g' | sed 's/ //g' | sed 's/=//g' | sed 's/MARKETING_VERSION//g')" >> $GITHUB_OUTPUT
print_current_version:
name: Print Current Version
Expand All @@ -89,150 +73,105 @@ jobs:
VERSION: ${{ needs.current_version.outputs.version }}
run: |
printf '%s\n' "$VERSION"
# current_version:
# name: Store Current Version
# runs-on: ubuntu-latest
# if: github.event_name == 'workflow_dispatch'
# outputs:
# version: ${{ steps.version.outputs.version }}
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Set Version Output
# id: version
# run: grep s\\.version\\s OAuth.podspec | sed 's/s.//' | sed "s/'//g" | sed 's/ //g' >> $GITHUB_OUTPUT

# print_current_version:
# name: Print Current Version
# runs-on: ubuntu-latest
# needs: [ current_version ]
# steps:
# - name: Print Current Version
# env:
# VERSION: ${{ needs.current_version.outputs.version }}
# run: |
# printf '%s\n' "$VERSION"
# bump_version:
# name: Store Bump Version
# runs-on: ubuntu-latest
# outputs:
# version: ${{ steps.version.outputs.version }}
# needs: [ current_version, version_increment_is_bump ]
# steps:
# - name: Bump Version
# if: ${{ needs.version_increment_is_bump.outputs.isBump == 'true' }}
# id: bump-semver
# uses: actions-ecosystem/action-bump-semver@v1
# with:
# current_version: ${{ needs.current_version.outputs.version }}
# level: ${{ inputs.versionIncrementType }}
# - name: Store Bump Version
# id: version
# run: |
# echo "version=${{ steps.bump-semver.outputs.new_version }}" >> $GITHUB_OUTPUT
bump_version:
name: Store Bump Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
needs: [ current_version, version_increment_is_bump ]
steps:
- name: Bump Version
if: ${{ needs.version_increment_is_bump.outputs.isBump == 'true' }}
id: bump-semver
uses: actions-ecosystem/action-bump-semver@v1
with:
current_version: ${{ needs.current_version.outputs.version }}
level: ${{ inputs.versionIncrementType }}
- name: Store Bump Version
id: version
run: |
echo "version=${{ steps.bump-semver.outputs.new_version }}" >> $GITHUB_OUTPUT
# print_bump_version:
# name: Print Bump Version
# runs-on: ubuntu-latest
# needs: [ bump_version, version_increment_is_bump ]
# if: ${{ needs.version_increment_is_bump.outputs.isBump == 'true' }}
# steps:
# - name: Print Bump Version
# env:
# VERSION: ${{ needs.bump_version.outputs.version }}
# run: |
# printf '%s\n' "$VERSION"
print_bump_version:
name: Print Bump Version
runs-on: ubuntu-latest
needs: [ bump_version, version_increment_is_bump ]
if: ${{ needs.version_increment_is_bump.outputs.isBump == 'true' }}
steps:
- name: Print Bump Version
env:
VERSION: ${{ needs.bump_version.outputs.version }}
run: |
printf '%s\n' "$VERSION"
# manual_version:
# name: Store Manual Version
# runs-on: ubuntu-latest
# outputs:
# version: ${{ steps.version.outputs.version }}
# if: inputs.versionIncrementType == 'manual'
# steps:
# - name: Store Manual Version
# id: version
# run: |
# echo "version=${{ inputs.manualVersionNumber }}" >> $GITHUB_OUTPUT
manual_version:
name: Store Manual Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
if: inputs.versionIncrementType == 'manual'
steps:
- name: Store Manual Version
id: version
run: |
echo "version=${{ inputs.manualVersionNumber }}" >> $GITHUB_OUTPUT
# print_manual_version:
# name: Print Manual Version
# runs-on: ubuntu-latest
# needs: [ manual_version ]
# if: inputs.versionIncrementType == 'manual'
# steps:
# - name: Print Manual Version
# env:
# VERSION: ${{ needs.manual_version.outputs.version }}
# run: |
# printf '%s\n' "$VERSION"
print_manual_version:
name: Print Manual Version
runs-on: ubuntu-latest
needs: [ manual_version ]
if: inputs.versionIncrementType == 'manual'
steps:
- name: Print Manual Version
env:
VERSION: ${{ needs.manual_version.outputs.version }}
run: |
printf '%s\n' "$VERSION"
# new_version:
# name: Store New Version
# runs-on: ubuntu-latest
# needs: [ version_increment_is_bump, bump_version ]
# if: ${{ needs.version_increment_is_bump.outputs.isBump == 'true' || inputs.versionIncrementType == 'manual' }}
# outputs:
# version: ${{ steps.version.outputs.version }}
# steps:
# - name: Store New Version
# id: version
# run: |
# if [ ${{ needs.version_increment_is_bump.outputs.isBump }} == 'true' ]; then
# echo "version=${{ needs.bump_version.outputs.version }}" >> $GITHUB_OUTPUT
# elif [ ${{ inputs.versionIncrementType }} == 'manual' ]; then
# echo "version=${{ inputs.manualVersionNumber }}" >> $GITHUB_OUTPUT
# else
# echo "No Version"
# fi

# print_new_version:
# name: Print New Version
# runs-on: ubuntu-latest
# needs: [ new_version ]
# steps:
# - name: Print New Version
# env:
# VERSION: ${{ needs.new_version.outputs.version }}
# run: |
# printf '%s\n' "$VERSION"

# create_version_branch_and_pull_request:
# name: Create Version Branch and PR
# runs-on: ubuntu-latest
# needs: [ current_version, new_version ]
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Set Podspec Version to New Version
# run: |
# sed -i "s/s.version = '${{ needs.current_version.outputs.version }}'/s.version = '${{ needs.new_version.outputs.version }}'/g" OAuth.podspec
# - name: Create Version Branch and PR
# uses: peter-evans/create-pull-request@v6
# with:
# branch: "versions/${{ needs.new_version.outputs.version }}"
# title: "Version ${{needs.new_version.outputs.version}}"
# commit-message: "Increase version to ${{needs.new_version.outputs.version}}"



new_version:
name: Store New Version
runs-on: ubuntu-latest
needs: [ version_increment_is_bump, bump_version ]
if: ${{ needs.version_increment_is_bump.outputs.isBump == 'true' || inputs.versionIncrementType == 'manual' }}
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Store New Version
id: version
run: |
if [ ${{ needs.version_increment_is_bump.outputs.isBump }} == 'true' ]; then
echo "version=${{ needs.bump_version.outputs.version }}" >> $GITHUB_OUTPUT
elif [ ${{ inputs.versionIncrementType }} == 'manual' ]; then
echo "version=${{ inputs.manualVersionNumber }}" >> $GITHUB_OUTPUT
else
echo "No Version"
fi
# fastlane_bump_version:
# name: Fastlane Bump Version
# runs-on: macos-14
# needs: [ version_increment_is_bump ]
# if: ${{ needs.version_increment_is_bump.outputs.isBump == 'true' }}
# steps:
# - name: Run Fastlane Bump Version
# run: bundle exec fastlane cru_shared_lane_increment_version_number bump_type:${{ inputs.versionIncrementType }}
print_new_version:
name: Print New Version
runs-on: ubuntu-latest
needs: [ new_version ]
steps:
- name: Print New Version
env:
VERSION: ${{ needs.new_version.outputs.version }}
run: |
printf '%s\n' "$VERSION"
# fastlane_set_version:
# name: Fastlane Set Version
# runs-on: macos-14
# needs: [ version_increment_is_bump ]
# if: ${{ needs.version_increment_is_bump.outputs.isBump == 'false' }}
# steps:
# - name: Run Fastlane Set Version
# run: bundle exec fastlane cru_shared_lane_increment_version_number version_number:${{ inputs.manualVersionNumber }}
create_version_branch_and_pull_request:
name: Create Version Branch and PR
runs-on: ubuntu-latest
needs: [ current_version, new_version ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set Podspec Version to New Version
run: |
sed -i "s/MARKETING_VERSION = ${{ needs.current_version.outputs.version }}/MARKETING_VERSION = ${{ needs.new_version.outputs.version }}/g" godtools.xcodeproj/project.pbxproj
- name: Create Version Branch and PR
uses: peter-evans/create-pull-request@v6
with:
branch: "versions/${{ needs.new_version.outputs.version }}"
title: "Version ${{needs.new_version.outputs.version}}"
commit-message: "Increase version to ${{needs.new_version.outputs.version}}"

0 comments on commit b31e4f2

Please sign in to comment.