Skip to content

Update Gaffer Version #7

Update Gaffer Version

Update Gaffer Version #7

name: Update Gaffer Version
on:
workflow_dispatch:
inputs:
version:
description: 'Gaffer Version'
required: true
permissions:
pull-requests: write
contents: write
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 's/^__version__.*"\(.*\)"$/\1/p' src/__init__.py`
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
- 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=tests/road-traffic-example/schema -Dgaffer.storeProperties=tests/road-traffic-example/federatedStore.properties -Dgaffer.graph.config=tests/road-traffic-example/federatedGraphConfig.json -jar spring-rest.jar &
sleep 1m
python src/generate.py
rm spring-rest.jar
- name: Set up Github credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Create PR branch
run: |
git checkout -b ${{ env.VERSION_UPDATE_BRANCH }}
git commit -am "Updated Gaffer version to ${{ github.event.inputs.version }}"
git push --set-upstream origin ${{ env.VERSION_UPDATE_BRANCH }}
- name: Submit PR
run: gh pr create --fill --head ${{ env.VERSION_UPDATE_BRANCH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}