Skip to content

Commit 9e42387

Browse files
committed
update actions to use ubuntu 20.04 & added getVersions automation so the wiki is updated automatically
1 parent 6049781 commit 9e42387

5 files changed

Lines changed: 68 additions & 11 deletions

File tree

.github/workflows/ari-apis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ARI4Java ARI APIs
1+
name: ARI4Java ARI APIs PR
22

33
on:
44
schedule:
@@ -7,16 +7,16 @@ on:
77

88
jobs:
99
getApis:
10-
runs-on: ubuntu-18.04
10+
runs-on: ubuntu-20.04
1111

1212
steps:
1313
- uses: actions/checkout@v2
1414

15-
- name: Grant execute permission for getApis
16-
run: chmod +x codegen/getApis.sh
17-
1815
- name: Execute getApis
19-
run: cd codegen && ./getApis.sh
16+
run: |
17+
cd codegen
18+
chmod +x getApis.sh
19+
./getApis.sh
2020
2121
- name: Create Pull Request
2222
id: cpr

.github/workflows/ari-versions.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: ARI4Java ARI Versions Wiki Update
2+
3+
on:
4+
schedule:
5+
- cron: '0 10 * * SAT'
6+
workflow_dispatch:
7+
8+
jobs:
9+
getApis:
10+
runs-on: ubuntu-20.04
11+
12+
steps:
13+
- name: Checkout Project
14+
uses: actions/checkout@v2
15+
- name: Checkout Wiki
16+
uses: actions/checkout@v2
17+
with:
18+
repository: ${{github.repository}}.wiki
19+
path: codegen/tmp/wiki
20+
21+
- name: Execute getVersions
22+
run: |
23+
cd codegen
24+
chmod +x getVersions.sh
25+
./getVersions.sh
26+
27+
- name: Push Wiki
28+
run: |
29+
cd codegen/tmp/wiki
30+
git config --local user.email "action@github.com"
31+
git config --local user.name "GitHub Action"
32+
git add .
33+
git diff-index --quiet HEAD || git commit -m "Update Versions" && git push

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
build:
15-
runs-on: ubuntu-18.04
15+
runs-on: ubuntu-20.04
1616

1717
steps:
1818
- uses: actions/checkout@v2

codegen/getVersions.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,24 @@
22

33
START_DIR=`pwd`
44

5-
cd tmp/asterisk
5+
if [ ! -d "tmp/wiki" ]
6+
then
7+
mkdir -p ${START_DIR}/tmp/wiki
8+
fi
69

7-
echo "| Asterisk | ARI |" > ${START_DIR}/versions.md
8-
echo "| :-- | :-- |" >> ${START_DIR}/versions.md
10+
if [ ! -d "tmp/asterisk" ]
11+
then
12+
mkdir tmp
13+
cd tmp
14+
git clone "https://gerrit.asterisk.org/asterisk"
15+
cd asterisk
16+
else
17+
cd tmp/asterisk
18+
git checkout master --force
19+
git pull origin
20+
fi
21+
22+
cat ${START_DIR}/versions-template.md > ${START_DIR}/tmp/wiki/Asterisk-Version-to-ARI-Version.md
923

1024
git show-ref --tags | while read tags
1125
do
@@ -21,7 +35,7 @@ do
2135
if [ -f "rest-api/resources.json" ]; then
2236
VER=`cat rest-api/resources.json | jq -r '.apiVersion'`
2337
echo ${VER}
24-
echo "| ${array[1]:10} | ${VER} |" >> ${START_DIR}/versions.md
38+
echo "| ${array[1]:10} | ${VER} |" >> ${START_DIR}/tmp/wiki/Asterisk-Version-to-ARI-Version.md
2539
fi
2640
done
2741

codegen/versions-template.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## ARI Versions
2+
3+
Within the Asterisk project ARI is versioned, these version numbers are not the same as the Asterisk version and also unrelated to ARI4Java's version.
4+
It is important to note the version of Asterisk you are running, so you can instantiate the library using the correct version.
5+
While using `AriVersion.IM_FEELING_LUCKY` tries to determine the correct version, it is recommended to rather specify a version for application stability. Generally it is safe to use an older version of ARI on a new Asterisk, but not the other way around.
6+
7+
The table below is built up using the git tags to link the Asterisk version to the corresponding ARI version:
8+
9+
| Asterisk | ARI |
10+
| :-- | :-- |

0 commit comments

Comments
 (0)