@@ -10,10 +10,10 @@ jobs:
1010 runs-on : ubuntu-20.04
1111
1212 steps :
13- - name : Checkout module
14- uses : actions/checkout@v2
13+ - name : Checkout module
14+ uses : actions/checkout@v3
1515
16- - id : set_var
16+ - id : set_var
1717 run : |
1818 content=`cat ./module.json`
1919 # the following lines are only required for multi line json
2626 - name : Set env
2727 run : echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
2828
29- - name : Check version equality
29+ - name : Check version equality
3030 run : |
3131 if [ "${{fromJson(steps.set_var.outputs.moduleJson).version}}" == $RELEASE_VERSION ]; then
3232 exit 0
@@ -44,20 +44,20 @@ jobs:
4444
4545 strategy :
4646 matrix :
47- php : ['7.3 ', '7.4 ']
47+ php : ['8.1 ', '8.2 ']
4848
4949 steps :
50- - name : Checkout Akaunting
51- uses : actions/checkout@v2
50+ - name : Checkout Akaunting
51+ uses : actions/checkout@v3
5252 with :
5353 repository : akaunting/akaunting
5454
55- - name : Checkout module to tmp path
56- uses : actions/checkout@v2
55+ - name : Checkout module to tmp path
56+ uses : actions/checkout@v3
5757 with :
5858 path : tmp-path-for-module
5959
60- - id : set_var
60+ - id : set_var
6161 run : |
6262 content=`cat ./tmp-path-for-module/module.json`
6363 # the following lines are only required for multi line json
6767 # end of optional handling for multi line json
6868 echo "::set-output name=moduleJson::$content"
6969
70- - name : Create module folder name which is PascalCase
70+ - name : Create module folder name which is PascalCase
7171 run : |
7272 MODULE_FOLDER_NAME=$(echo -n ${{fromJson(steps.set_var.outputs.moduleJson).alias}} | sed -r 's/(^|-)([a-z])/\U\2/g')
7373 echo "MODULE_FOLDER_NAME=${MODULE_FOLDER_NAME}" >> $GITHUB_ENV
7676 run : rm -rf tmp-path-for-module
7777
7878 - name : Checkout module
79- uses : actions/checkout@v2
79+ uses : actions/checkout@v3
8080 with :
8181 path : modules/${{ env.MODULE_FOLDER_NAME }}
8282
@@ -86,20 +86,20 @@ jobs:
8686 path : ~/.composer/cache/files
8787 key : php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
8888
89- - name : Setup PHP
89+ - name : Setup PHP
9090 uses : shivammathur/setup-php@v2
9191 with :
9292 php-version : ${{ matrix.php }}
9393 extensions : bcmath, ctype, dom, fileinfo, intl, gd, json, mbstring, pdo, pdo_sqlite, openssl, sqlite, xml, zip
9494 coverage : none
9595
96- - name : Copy .env
96+ - name : Copy .env
9797 run : cp .env.testing .env
9898
99- - name : Install Composer
99+ - name : Install Composer
100100 run : cd "modules/${{ env.MODULE_FOLDER_NAME }}" ; composer test ; cd ../.. ; composer test
101101
102- - name : Execute tests
102+ - name : Execute tests
103103 run : php artisan test --parallel
104104
105105 build :
@@ -110,12 +110,12 @@ jobs:
110110
111111 steps :
112112 - name : Checkout Akaunting
113- uses : actions/checkout@v2
113+ uses : actions/checkout@v3
114114 with :
115115 repository : akaunting/akaunting
116116
117117 - name : Checkout module to tmp path
118- uses : actions/checkout@v2
118+ uses : actions/checkout@v3
119119 with :
120120 path : tmp-path-for-module
121121
@@ -138,20 +138,20 @@ jobs:
138138 echo "MODULE_FOLDER_NAME=${MODULE_FOLDER_NAME}" >> $GITHUB_ENV
139139
140140 - name : Checkout module
141- uses : actions/checkout@v2
141+ uses : actions/checkout@v3
142142 with :
143143 path : modules/${{ env.MODULE_FOLDER_NAME }}
144144
145145 - name : Cache Composer
146146 uses : actions/cache@v1
147147 with :
148148 path : ~/.composer/cache/files
149- key : php-7.3 -composer-${{ hashFiles('composer.json') }}
149+ key : php-8.1 -composer-${{ hashFiles('composer.json') }}
150150
151151 - name : Setup PHP
152152 uses : shivammathur/setup-php@v2
153153 with :
154- php-version : ' 7.3 '
154+ php-version : ' 8.1 '
155155 extensions : bcmath, ctype, dom, fileinfo, intl, gd, json, mbstring, pdo, pdo_sqlite, openssl, sqlite, xml, zip
156156 coverage : none
157157
@@ -166,24 +166,27 @@ jobs:
166166
167167 - name : Run npm install for the module
168168 run : |
169+
169170 cd "modules/${{ env.MODULE_FOLDER_NAME }}"
170171 npm install
171172
172173 - name : Compile module assets
173174 run : |
175+
176+
174177 cd "modules/${{ env.MODULE_FOLDER_NAME }}"
178+
175179 npm run production
176-
177- - name : Install zip
180+ - name : Install zip
178181 run : sudo apt install zip
179182
180- - name : Delete sass folder
181- run : |
183+ - name : Delete sass folder
184+ run : |
182185 cd "modules/${{ env.MODULE_FOLDER_NAME }}/Resources/assets"
183186 rm -rf sass
184187
185188 - name : Delete mix-manifest.json file
186- run : |
189+ run : |
187190 cd "modules/${{ env.MODULE_FOLDER_NAME }}"
188191 rm -f mix-manifest.json
189192
@@ -192,10 +195,11 @@ jobs:
192195 cd "modules/${{ env.MODULE_FOLDER_NAME }}/Resources/assets/js"
193196 find . -type f ! -name '*.min.js' -delete
194197
195- - name : ZIP
198+ - name : ZIP
196199 run : cd "modules/${{ env.MODULE_FOLDER_NAME }}" ; zip -r ../../final-build.zip . * -x '*.git*' -x '*node_modules*' -x 'composer.json' -x 'composer.lock' -x 'crowdin.yml' -x 'package-lock.json' -x 'package.json' -x 'README.md' -x 'webpack.mix.js' ; cd ..
197200
198201 - uses : actions/upload-artifact@master
202+
199203 with :
200204 name : final-build
201205 path : ${{ github.workspace }}/final-build.zip
@@ -238,12 +242,14 @@ jobs:
238242 tag : ${{ github.ref }}
239243 overwrite : true
240244
241- - name : Upload to Akaunting Site
245+ - name : Upload to Akaunting Site
242246 run : |
243247 curl \
244248 -H "Authorization: Bearer ${{ secrets.AKAUNTING_SITE_AUTH_BEARER }}" \
249+
245250 -H "Module-Version: ${{fromJson(steps.set_var.outputs.moduleJson).version}}" \
246251 -F "file=@./${{fromJson(steps.set_var.outputs.moduleJson).alias}}-v${{fromJson(steps.set_var.outputs.moduleJson).version}}.zip" \
252+
247253 --retry 5 \
248254 --retry-delay 60 \
249255 ${{ secrets.AKAUNTING_SITE_API_DOMAIN }}/${{ secrets.AKAUNTING_SITE_API_MODULES_ENDPOINT }}/${{fromJson(steps.set_var.outputs.moduleJson).alias}}
@@ -255,17 +261,17 @@ jobs:
255261 runs-on : ubuntu-20.04
256262
257263 steps :
258- - uses : actions/download-artifact@master
264+ - uses : actions/download-artifact@master
259265 with :
260266 name : final-build
261267
262- - name : Install unzip
268+ - name : Install unzip
263269 run : sudo apt install unzip
264270
265- - name : UNZIP
271+ - name : UNZIP
266272 run : unzip final-build.zip -d src
267273
268- - id : set_var
274+ - id : set_var
269275 run : |
270276 content=`cat ./src/module.json`
271277 # the following lines are only required for multi line json
0 commit comments