-
Notifications
You must be signed in to change notification settings - Fork 31
40 lines (32 loc) · 1.28 KB
/
weekly-release-bump.yaml
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
name: Weekly Release Patch Bump
on:
schedule:
- cron: '0 6 * * 1' # 2 AM EST (UTC-4) on Monday mornings
workflow_dispatch:
jobs:
bump-patch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Find Latest Release Branch
id: find-branch
run: |
latest_version=$(git branch -r | grep 'origin/RELEASE_' | sed 's|origin/||' | grep -oP 'RELEASE_\K\d+_\d+' | sort -Vr | head -n1)
latest_branch=$(echo "RELEASE_${latest_version}" | sed 's/\./_/g')
echo "Detected latest release branch: $latest_branch"
echo "branch=$latest_branch" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
ref: ${{ steps.find-branch.outputs.branch }}
token: ${{ secrets.PAT }}
- name: Run patch bump script and push
run: |
git checkout ${{ steps.find-branch.outputs.branch }}
sed -r -i 's/(^ARG BIOCONDUCTOR_PATCH=)([0-9]+)$/echo "\1$((\2+1))"/ge' Dockerfile
git config user.name github-actions
git config user.email [email protected]
git add Dockerfile
git commit -m "Weekly auto-bump Dockerfile patch version for latest release" || exit 0
git push origin ${{ steps.find-branch.outputs.branch }}