Skip to content

Commit 0d5e923

Browse files
committed
Add two more GitHub Actions workflows
This change adds: * `tag.yml`: Creates a new tag every time the master or a release branch is pushed. * `backport.yml`: Creates a cherry-pick in older release branches to keep them up to date with little cost.
1 parent 5314951 commit 0d5e923

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

.github/workflows/backport.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Backport to older releases
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
9+
backport:
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
branch: [ 'release-0.28', 'release-0.27' ]
14+
name: Backport change to branch ${{ matrix.branch }}
15+
16+
runs-on: ubuntu-20.04
17+
18+
steps:
19+
- name: Check out code
20+
uses: actions/checkout@v1
21+
with:
22+
fetch-depth: 0
23+
- name: Create a cherry-pick PR
24+
run: |
25+
if ! git diff --quiet HEAD:vendor/libgit2 HEAD^:vendor/libgit2; then
26+
echo '::warning::Skipping cherry-pick since it is a vendored libgit2 bump'
27+
exit 0
28+
fi
29+
30+
git checkout ${{ matrix.branch }}
31+
git switch -c "cherry-pick-${{ github.id }}-${{ matrix.branch }}"
32+
git cherry-pick -x ${{ github.sha }}
33+
gh pr create \
34+
--base ${{ matrix.branch }} \
35+
--title "$(git show --format="%s" --no-patch HEAD)" \
36+
--body "$(git show --format="%b" --no-patch HEAD)"
37+

.github/workflows/tag.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Tag new releases
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- release-*
7+
8+
jobs:
9+
10+
tag-release:
11+
name: Bump tag in ${{ github.ref }}
12+
13+
runs-on: ubuntu-20.04
14+
15+
steps:
16+
- name: Check out code
17+
uses: actions/checkout@v1
18+
with:
19+
fetch-depth: 0
20+
- name: Bump version and push tag
21+
id: bump-version
22+
uses: anothrNick/github-tag-action@c170e78287f338a4af0dc49e033e50e5a072d82b
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
WITH_V: true
26+
DEFAULT_BUMP: patch
27+
TAG_CONTEXT: branch
28+
RELEASE_BRANCHES: master,release-.*

0 commit comments

Comments
 (0)