Skip to content

Commit

Permalink
Gh-33: Update GitHub workflows (#34)
Browse files Browse the repository at this point in the history
* Update GitHub worflows

* Remove unnecessary file

* Update sed
  • Loading branch information
t92549 authored Nov 21, 2023
1 parent 34861c6 commit e78aac8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 100 deletions.
17 changes: 0 additions & 17 deletions .github/release-notes.yml

This file was deleted.

13 changes: 3 additions & 10 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,17 @@ jobs:
distribution: 'zulu'
java-version: '8'

- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
jetty-runner.jar
road-traffic-rest-2.0.0.war
key: road-traffic-dependencies

- name: Start road-traffic example
run: |
gafferVersion=`sed -n 's/^__version__.*"\(.*\)"$/\1/p' src/__init__.py`
curl -o jetty-runner.jar https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-runner/9.4.52.v20230823/jetty-runner-9.4.52.v20230823.jar
curl -o road-traffic-rest-2.0.0.war https://repo1.maven.org/maven2/uk/gov/gchq/gaffer/road-traffic-rest/2.0.0/road-traffic-rest-2.0.0.war
curl -o road-traffic-rest.war https://repo1.maven.org/maven2/uk/gov/gchq/gaffer/road-traffic-rest/$gafferVersion/road-traffic-rest-$gafferVersion.war
java \
-Dgaffer.storeProperties=src/test/road-traffic-example/store.properties \
-Dgaffer.graph.config=src/test/road-traffic-example/graphConfig.json \
-Dgaffer.schemas=src/test/road-traffic-example/schema \
-DroadTraffic.dataLoader.dataPath=src/test/road-traffic-example/roadTrafficSampleData.csv \
-jar jetty-runner.jar --path rest road-traffic-rest-2.0.0.war &
-jar jetty-runner.jar --path rest road-traffic-rest.war &
sleep 1m
- name: Run Python tests
Expand Down
65 changes: 0 additions & 65 deletions .github/workflows/release.yaml

This file was deleted.

27 changes: 19 additions & 8 deletions .github/workflows/update-gaffer-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
description: 'Gaffer Version'
required: true

permissions:
pull-requests: write
contents: write

jobs:
update-gaffer-version:
runs-on: ubuntu-latest
Expand All @@ -24,14 +28,12 @@ jobs:

- name: Update Gaffer Version
run: |
oldVersion=`sed -n '/^__version__\ =\ / {s///p;q;}' src/__init__.py | tr -d '"'`
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
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: |
Expand All @@ -42,9 +44,18 @@ jobs:
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
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 }}
run: gh pr create --fill --head ${{ env.VERSION_UPDATE_BRANCH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit e78aac8

Please sign in to comment.