Skip to content

Update Gaffer Version #1

Update Gaffer Version

Update Gaffer Version #1

name: Update Gaffer Version
on:
workflow_dispatch:
inputs:
version:
description: 'Gaffer Version'
required: true
jobs:
update-gaffer-version:
runs-on: ubuntu-latest
env:
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: |
oldVersion=`sed -n '/^__version__\ =\ / {s///p;q;}' src/__init__.py | tr -d '"'`
newVersion=${{ github.event.inputs.version }}
sed -i'' "s#__version__ = \"$oldVersion\"#__version__ = \"$newVersion\"#g" src/__init__.py
sed -i'' "s#__version__ = \"$oldVersion\"#__version__ = \"$newVersion\"#g" src/*/__init__.py
sed -i'' "s#release = '$oldVersion'#release = '$newVersion'#g" docs/source/conf.py
sed -i'' "s#road-traffic-rest-$oldVersion.war#road-traffic-rest-$newVersion.war#g" .github/workflows/continuous-integration.yaml
sed -i'' "s#road-traffic-rest\/$oldVersion\/#road-traffic-rest\/$newVersion\/#g" .github/workflows/continuous-integration.yaml
- 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=src/test/road-traffic-example/schema -Dgaffer.storeProperties=src/test/road-traffic-example/federatedStore.properties -Dgaffer.graph.config=src/test/road-traffic-example/federatedGraphConfig.json -jar spring-rest.jar &
sleep 1m
python 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 }}