-
Notifications
You must be signed in to change notification settings - Fork 20
54 lines (46 loc) · 1.63 KB
/
bump-snapshot-version.yml
File metadata and controls
54 lines (46 loc) · 1.63 KB
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
name: Bump snapshot version
on:
workflow_call:
inputs:
next_version:
required: true
type: string
workflow_dispatch:
inputs:
next_version:
description: 'Next version. Specify <major.minor.patch>, e.g. 7.2.0 (Do NOT include -SNAPSHOT, this will be added automatically)'
required: true
permissions:
contents: write
pull-requests: write
jobs:
bump-snapshot-version:
name: Bump snapshot version
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout SDK
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: true
- name: Set next version
env:
NEXT_VERSION: ${{ inputs.next_version }}
run: sed -i -r "s#version=([^\']+)#version=${NEXT_VERSION}-SNAPSHOT#" gradle.properties
- name: Create PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEXT_VERSION: ${{ inputs.next_version }}
run: |
git config --global user.name 'embrace-ci[bot]'
git config --global user.email 'embrace-ci@users.noreply.github.com'
branch=sdk-version-update-${{ github.run_id }}
git checkout -b $branch
git add gradle.properties
git commit -m "CI/CD: set next version: ${NEXT_VERSION}-SNAPSHOT"
git push -f origin $branch
gh pr create \
--base main \
--head $branch \
--title "CI/CD: set next version: ${NEXT_VERSION}-SNAPSHOT" \
--body "This is an autogenerated PR, created by the bump-snapshot-version.yml workflow"