-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (67 loc) · 2.22 KB
/
_reusable_update_version.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
name: Update Version
on:
workflow_call:
inputs:
version:
type: string
required: true
merge-upstream-ignoring-conflicts:
type: boolean
default: false
secrets:
KSM_CONFIG:
required: true
BONITA_CI_PAT:
required: true
jobs:
update-version:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
repository: bonitasoft/bonita-super-admin-application
ref: ${{ github.ref }}
token: ${{ secrets.BONITA_CI_PAT }}
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Setup Maven
uses: bonitasoft/maven-settings-action@v1
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
- name: Update version
run: ./mvnw -B -ntp versions:set -DnewVersion=${{ inputs.version }} -DprocessAllModules=true
- name: Git Setup
uses: bonitasoft/git-setup-action@v1
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
- name: Commit and push
run: |
git commit -a -m "chore(versioning): update version to ${{ inputs.version }}"
git push
merge-upstream:
needs: update-version
if: ${{ inputs.merge-upstream-ignoring-conflicts }}
runs-on: ubuntu-22.04
steps:
- name: Setup git
uses: bonitasoft/git-setup-action@v1
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
- name: Determine upstream branch
id: upstream-branch
run: echo "ref=${{ fromJson(vars.SUPPORTED_BRANCHES).upstream-branch[github.ref_name] }}" >> $GITHUB_OUTPUT
- name: Checkout upstream branch
uses: actions/checkout@v4
with:
repository: bonitasoft/bonita-super-admin-application
ref: ${{ steps.upstream-branch.outputs.ref }}
fetch-depth: 0
token: ${{ secrets.BONITA_CI_PAT }}
- name: Merge upstream branch
run: |
git config merge.ours.driver true
git merge origin/${{ github.ref_name }} -X ours -m "chore(merge): ${{ github.ref_name }} into ${{ steps.upstream-branch.outputs.ref }}"
git push