Skip to content

Commit

Permalink
Merge pull request #6 from NethermindEth/master
Browse files Browse the repository at this point in the history
Automatic PR's
  • Loading branch information
eduadiez authored Jan 13, 2020
2 parents bf4bcec + d271070 commit 3e4cf3d
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/dappnode-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Update Manifest file

on:
repository_dispatch:
types: dappnode_update

jobs:
dappnode-update:
name: Update Manifest file
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cloning nethermind repo and fetching latest tag
run: |
git clone https://github.com/NethermindEth/nethermind.git
cd nethermind/ && git describe --tags > git-tag
- name: Updating package and Nethermind versions
run: |
GIT_TAG="$(tail nethermind/git-tag)"
VER="$(sed -n '3p' dappnode_package.json)"
VERSION=${VER:14:-2}
VERSION_UPDATED="$(./semver-update.sh patch $VERSION)"
sed -i "3s/.*/ \"version\": \"${VERSION_UPDATED}\",/" dappnode_package.json
sed -i "4s/.*/ \"upstreamVersion\": \"v${GIT_TAG}\",/" dappnode_package.json
sed -i "5s/.*/ image: 'nethermind.public.dappnode.eth:${VERSION_UPDATED}'/" docker-compose.yml
rm -rf nethermind/
- name: Create Pull Request
uses: peter-evans/create-pull-request@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update manifest
body: |
Manifest file has been updated.
- Files included - dappnode_package.json
- Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
title: 'Updating Manifest file'
labels: manifest
author-name: github-actions[bot]
author-email: 41898282+github-actions[bot]@users.noreply.github.com
committer-name: GitHub
committer-email: [email protected]
branch: manifest-update
branch-suffix: short-commit-hash
base: master
- name: Checking Outputs
run: |
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
build_*
build_*
37 changes: 37 additions & 0 deletions semver-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#! /bin/bash

RE='[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z-]*\)'

step="$1"
if [ -z "$1" ]
then
step=patch
fi

base="$2"
if [ -z "$2" ]
then
base=$(git tag 2>/dev/null| tail -n 1)
if [ -z "$base" ]
then
base=0.0.0
fi
fi

MAJOR=`echo $base | sed -e "s#$RE#\1#"`
MINOR=`echo $base | sed -e "s#$RE#\2#"`
PATCH=`echo $base | sed -e "s#$RE#\3#"`

case "$step" in
major)
let MAJOR+=1
;;
minor)
let MINOR+=1
;;
patch)
let PATCH+=1
;;
esac

echo "$MAJOR.$MINOR.$PATCH"

0 comments on commit 3e4cf3d

Please sign in to comment.