Skip to content

Commit

Permalink
Merge pull request #305 from bitmovin/improve-start-release-workflow
Browse files Browse the repository at this point in the history
Improve start release workflow
  • Loading branch information
rolandkakonyi authored Dec 18, 2023
2 parents a262de3 + 2d85db8 commit fe684d5
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions .github/workflows/start-release-train.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
description: 'Date of the final release. Will be used for CHANGELOG.md (format YYYY-MM-DD, e.g. 2023-02-27)'
type: string
required: true
dry_run:
description: 'If true, the workflow will not create a PR'
type: boolean
required: false
default: false
env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
Expand Down Expand Up @@ -43,8 +48,10 @@ jobs:
run: |
branch_name="release/v${{ inputs.version_number }}"
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT
echo "$branch_name"
- name: Create Release Branch
if: ${{ !inputs.dry_run }}
run: |
# Delete the release branch if already exists, useful in case we need to re-run this workflow
git push origin --delete ${{ steps.branching.outputs.branch_name }} || true
Expand All @@ -53,26 +60,60 @@ jobs:
- name: Bump changelog version
run: |
sed -i'.bak' "s/\[Unreleased\]/\[${{ inputs.version_number }}\] \(${{ inputs.release_date }}\)/g" CHANGELOG.md
awk 'BEGIN {count=0} /## \[/ {count++; if (count == 2) exit} {print}' CHANGELOG.md
- name: Bump package.json version
run: |
yarn version --new-version ${{ inputs.version_number }} --no-git-tag-version
- name: Update Podfile.lock
- name: Restore Pods cache
id: pods-cache-restore
uses: actions/cache/restore@v3
with:
path: |
.cocoapods-cache
example/ios/Pods
key: pods-${{ hashFiles('example/ios/Podfile.lock') }}
restore-keys: pods-

- name: Set up CocoaPods
run: |
pod repo remove trunk
pod repo add bitmovin https://github.com/bitmovin/cocoapod-specs.git || pod repo update bitmovin
working-directory: example/ios
env:
CP_HOME_DIR: ${{ github.workspace }}/.cocoapods-cache

- name: Install pods to update Podfile.lock
run: |
yarn bootstrap
env:
CP_HOME_DIR: ${{ github.workspace }}/.cocoapods-cache
NO_FLIPPER: 1

- name: Save Pods cache
if: steps.pods-cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: |
.cocoapods-cache
example/ios/Pods
key: ${{ steps.pods-cache-restore.outputs.cache-primary-key }}

- name: Commit changelog version bump
if: ${{ !inputs.dry_run }}
run: |
git add CHANGELOG.md package.json example/ios/Podfile.lock
git commit -m "chore: prepare release ${{ inputs.version_number }}"
git push origin ${{ steps.branching.outputs.branch_name }}
- name: Create PR
if: ${{ !inputs.dry_run }}
run: |
gh pr create \
--base "main" \
--title "Release ${{ inputs.version_number }}" \
--body "Release ${{ inputs.version_number }}"
--body "Release ${{ inputs.version_number }}.\n\nPlease review and merge this PR to continue the release process." \
--reviewer "${{ github.actor }}"
env:
GH_TOKEN: ${{ github.token }}

0 comments on commit fe684d5

Please sign in to comment.