Skip to content

Finish Release Train #16

Finish Release Train

Finish Release Train #16

name: Finish Release Train
on: workflow_dispatch
env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
concurrency:
group: finish-release-train-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare:
name: Extracts the version number from the release branch
runs-on: ubuntu-latest
outputs:
version_number: ${{ steps.version_number.outputs.version_number }}
steps:
- name: Verify release branch
if: "!contains(github.ref, 'release')"
run: exit 1
- uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.name "Bitmovin Release Automation"
git config --global user.email "[email protected]"
- name: Detect version number
id: version_number
run: |
version_number=$(echo "${{ github.ref }}" | rev | cut -d '/' -f1 | rev)
echo "Detected version number: $version_number"
echo "version_number=$version_number" >> $GITHUB_OUTPUT
- name: Update Changelog
run: |
sed -i "s/\[${{ steps.version_number.outputs.version_number }}\].*/\[${{ steps.version_number.outputs.version_number }}\] - $(date +'%Y-%m-%d')/g" CHANGELOG.md
- name: Commit changelog version bump
run: |
git add CHANGELOG.md
git commit -m "chore: bump changelog date to today"
git push origin ${{ github.ref }}
trigger_publish:
name: Push tag to trigger publishing to pub dev
needs: [prepare]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
ssh-key: ${{ secrets.PLAYER_FLUTTER_DEPLOY_KEY }}
- name: Setup Git User
run: |
git config --global user.name "Bitmovin Release Automation"
git config --global user.email "[email protected]"
- name: Add tag
run: |
git tag ${{ needs.prepare.outputs.version_number }}
- name: Push tag
run: |
git push origin ${{ needs.prepare.outputs.version_number }}
create_pr:
name: Create PR
needs: [prepare, trigger_publish]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup Git User
run: |
git config --global user.name "Bitmovin Release Automation"
git config --global user.email "[email protected]"
- name: Create PR
run: |
gh pr create \
--base "main" \
--title "Release ${{ needs.prepare.outputs.version_number }}" \
--body "Release ${{ needs.prepare.outputs.version_number }}. Please review and merge this PR." \
--reviewer "${{ github.actor }}"
env:
GH_TOKEN: ${{ github.token }}