This repository has been archived by the owner on Oct 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
53 lines (45 loc) · 2.23 KB
/
update-gaffer-version.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
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Update Gaffer Version
on:
workflow_dispatch:
inputs:
version:
description: 'Gaffer Version'
required: true
jobs:
update-gaffer-version:
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25
VERSION_UPDATE_BRANCH: updating-gaffer-version-${{ github.event.inputs.version }}
steps:
- name: Checkout base branch
uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
- name: Update Gaffer Version
run: |
mvn -q org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.parent.version
oldVersion=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.parent.version | grep -v '\['`
newVersion=${{ github.event.inputs.version }}
sed -i'' "s#version>$oldVersion<#version>$newVersion<#g" pom.xml
sed -i'' "s#gaffer2:$oldVersion#gaffer2:$newVersion#g" NOTICES
sed -i'' "s#__version__ = \"$oldVersion\"#__version__ = \"$newVersion\"#g" python-shell/__init__.py
sed -i'' "s#__version__ = \"$oldVersion\"#__version__ = \"$newVersion\"#g" python-shell/src/__init__.py
sed -i'' "s#__version__ = \"$oldVersion\"#__version__ = \"$newVersion\"#g" python-shell/src/*/__init__.py
- name: Update gafferpy
run: |
newVersion=${{ github.event.inputs.version }}
curl -o spring-rest.jar https://repo.maven.apache.org/maven2/uk/gov/gchq/gaffer/spring-rest/$newVersion/spring-rest-$newVersion-exec.jar
java -Dgaffer.schemas=cd/road-traffic-example/schema -Dgaffer.storeProperties=cd/road-traffic-example/federatedStore.properties -Dgaffer.graph.config=cd/road-traffic-example/federatedGraphConfig.json -jar spring-rest.jar &
sleep 1m
python python-shell/src/generate.py
rm spring-rest.jar
- name: Submit PR
uses: peter-evans/create-pull-request@v4
with:
title: Updated Gaffer version to ${{ github.event.inputs.version }}
commit-message: Updated Gaffer version to ${{ github.event.inputs.version }}
branch: ${{ env.VERSION_UPDATE_BRANCH }}