-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (41 loc) · 1.59 KB
/
update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Update version
on:
schedule:
- cron: 0 * * * *
jobs:
update-version:
name: update-version
runs-on: ubuntu-latest
steps:
- name: Check out code.
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Run gitwerk semver-auto
run: |
CURRENT_VERSION=`cat VALD_CLIENT_CLJ_VERSION`
VERSION=`curl -s https://raw.githubusercontent.com/vdaas/vald-client-java/master/VALD_CLIENT_JAVA_VERSION`
VERSION="v${VERSION}"
if [ "$CURRENT_VERSION" = "${VERSION}" ];then
echo "not updated"
exit 0
fi
VERSION=`curl -s "http://search.maven.org/solrsearch/select?q=vald-client-java&rows=20&wt=json&start=0" | jq -r '.response.docs[] | select(.a == "vald-client-java") | .latestVersion'`
VERSION="v${VERSION}"
if [ "$CURRENT_VERSION" = "${VERSION}" ];then
echo "not uploaded to maven repository"
exit 0
fi
echo "${VERSION}" > VALD_CLIENT_CLJ_VERSION
git checkout master
git config --global user.name "VDaaS org"
git config --global user.email "ci@vdaas.org"
git add VALD_CLIENT_CLJ_VERSION
git commit --signoff -m ":bookmark: Release ${VERSION}"
git tag ${VERSION}
git remote set-url origin "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git push origin master
git push origin ${VERSION}
env:
GITHUB_USER: ${{ secrets.VALDCLI_USER }}
GITHUB_TOKEN: ${{ secrets.VALDCLI_TOKEN }}