Start Release Train #14
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: Start Release Train | |
on: | |
workflow_dispatch: | |
inputs: | |
version_number: | |
description: 'Version number of the release' | |
type: string | |
required: true | |
env: | |
LC_ALL: en_US.UTF-8 | |
LANG: en_US.UTF-8 | |
concurrency: | |
group: start-release-train-${{ inputs.version_number }} | |
cancel-in-progress: true | |
jobs: | |
create_release_branch: | |
name: Create release branch and bump version | |
runs-on: macos-14 | |
outputs: | |
branch_name: ${{ steps.branching.outputs.branch_name }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/prepare-dependencies | |
- name: Setup Git user | |
run: | | |
git config --global user.name "Bitmovin Release Automation" | |
git config --global user.email "[email protected]" | |
- name: Set release branch name | |
id: branching | |
run: | | |
branch_name="release/${{ inputs.version_number }}" | |
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT | |
echo "$branch_name" | |
- name: Create Release Branch | |
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 | |
git checkout -b ${{ steps.branching.outputs.branch_name }} | |
- name: Bump changelog version | |
run: | | |
sed -i'.bak' "s/\[Unreleased\]/\[${{ inputs.version_number }}\]/g" CHANGELOG.md | |
awk 'BEGIN {count=0} /## \[/ {count++; if (count == 2) exit} {print}' CHANGELOG.md | |
- name: Bump package version | |
run: | | |
dart pub global activate cider | |
dart pub global run cider version ${{ inputs.version_number }} | |
flutter pub get | |
- name: Install pods to update Podfile.lock | |
working-directory: example/ios | |
run: pod install --repo-update | |
- name: Commit version bump | |
run: | | |
git add CHANGELOG.md pubspec.yaml example/ios/Podfile.lock example/pubspec.lock | |
git commit -m "chore: prepare release ${{ inputs.version_number }}" | |
git push origin ${{ steps.branching.outputs.branch_name }} | |
publish_dry_run: | |
name: Dry run for publishing to pub.dev | |
needs: create_release_branch | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ needs.create_release_branch.outputs.branch_name }} | |
- uses: ./.github/actions/prepare-dependencies | |
- name: Publish dry run | |
run: dart pub publish --dry-run |