Skip to content

Commit

Permalink
Merge pull request #27 from whelk-io/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
zteater authored Dec 28, 2019
2 parents 77d4a5f + 3723269 commit ba44ddb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,22 @@ jobs:

steps:
- uses: actions/checkout@v1

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Parse Version from POM
shell: bash
run: |
cat pom.xml | grep version -m 2 | tail -1 | awk '{$1=$1};1' | awk -F'>' '{print $2}' | awk -F'<' '{print $1}' > /tmp/version.txt
- name: Print version
shell: bash
run: |
version=`cat /tmp/version.txt` && echo Deploying $version
- name: Release package
run: |
version=`cat /tmp/version.txt` &&
Expand All @@ -32,13 +36,29 @@ jobs:
-H 'Content-Type: application/json' \
-H 'Host: api.github.com' \
-d '{ "tag_name": "'$version'", "target_commitish": "master", "name": "'$version'", "body": "Release deployment", "draft": false, "prerelease": false }'
- name: Create Maven settings.xml
uses: s4u/maven-settings-action@v1
with:
servers: '[{"id": "github", "username": "${{ secrets.PACKAGE_KEY }}", "password": "${{ secrets.PACKAGE_TOKEN }}"}]'

- name: Deploy package
run: mvn -B deploy --file pom.xml




- name: Checkout develop branch
uses: actions/checkout@master
with:
branch: develop

- name: Merge master to develop
run: |
git config --local user.email ${{ secrets.BUILD_EMAIL }}
git config --local user.name ${{ secrets.BUILD_USERNAME }}
git pull
git merge origin/master
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: develop
github_token: ${{ secrets.GITHUB_TOKEN }}

11 changes: 3 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,14 @@ jobs:
- name: Increment version in pom.xml
run: |
old_version=`cat /tmp/release.json | grep tag_name -m 1 | awk '{$1=$1};1' | awk -F':' '{print $2}' | awk -F'"' '{print $2}'` \
&& echo $old_version \
&& echo "Old version: " $old_version \
&& major_version=`echo $old_version | awk -F'-' '{print $1}' | awk -F'.' '{print $1}'` \
&& echo $major_version \
&& minor_version=`echo $old_version | awk -F'-' '{print $1}' | awk -F'.' '{print $2}'` \
&& echo $minor_version \
&& patch_version=`echo $old_version | awk -F'-' '{print $1}' | awk -F'.' '{print $3}'` \
&& echo $patch_version \
&& let "patch_version+=1" \
&& echo $patch_version \
&& new_version=$major_version"."$minor_version"."$patch_version"-RELEASE" \
&& echo $new_version \
&& mvn -B versions:set -DnewVersion=$new_version --file pom.xml \
&& echo pom.xml
&& echo "New version: " $new_version \
&& mvn -B versions:set -DnewVersion=$new_version --file pom.xml
- name: Commit files
run: |
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>io.whelk.flesch.kincaid</groupId>
<artifactId>whelk-flesch-kincaid</artifactId>
<version>0.0.8-RELEASE</version>
<version>0.0.9-RELEASE</version>
<name>Flesch Kincaid</name>
<description>Java OSS library for performing Flesch-Kincaid readability tests.</description>
<url>https://github.com/whelk-io/flesch-kincaid</url>
Expand Down

0 comments on commit ba44ddb

Please sign in to comment.