-
Notifications
You must be signed in to change notification settings - Fork 3
95 lines (79 loc) · 2.78 KB
/
finish-release-train.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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 }}