-
Notifications
You must be signed in to change notification settings - Fork 10
58 lines (50 loc) · 2.22 KB
/
update-v1docs-gaffer-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
name: Update v1docs Gaffer Version
on:
workflow_dispatch:
inputs:
version:
description: 'v1 Gaffer Version'
required: true
jobs:
update-v1docs-gaffer-version:
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25
VERSION_UPDATE_BRANCH: updating-v1docs-gaffer-version-${{ github.event.inputs.version }}
steps:
- name: Checkout v1docs
uses: actions/checkout@v4
with:
ref: v1docs
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
- name: Setup Github credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
- name: Create branch with new v1docs Gaffer Version
run: |
newVersion=${{ github.event.inputs.version }}
git checkout -b ${{ env.VERSION_UPDATE_BRANCH }}
mvn -q org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.parent.version
oldGafferVersion=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.parent.version | grep -v '\['`
oldGafferToolsVersion=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=gaffer-tools.version | grep -v '\['`
sed -i'' "s/version>$oldGafferVersion</version>$newVersion</g" pom.xml
sed -i'' "s/version>$oldGafferToolsVersion</version>$newVersion</g" pom.xml
sed -i'' "s/gaffer2:$oldGafferVersion/gaffer2:$newVersion/g" NOTICES
sed -i'' "s/gaffer-tools:$oldGafferToolsVersion/gaffer-tools:$newVersion/g" NOTICES
sed -i'' "s/>Version $oldGafferVersion</>Version $newVersion</g" docs/README.md
git add .
git commit -a -m "Updated Gaffer version to $newVersion"
git push -u origin ${{ env.VERSION_UPDATE_BRANCH }}
- name: Submit PR
if: ${{ success() }}
uses: repo-sync/pull-request@v2
with:
source_branch: ${{ env.VERSION_UPDATE_BRANCH }}
destination_branch: v1docs
github_token: ${{ secrets.ADMIN_GITHUB_TOKEN }}