Commit 58e1adf 1 parent 21a9b20 commit 58e1adf Copy full SHA for 58e1adf
File tree 3 files changed +36
-16
lines changed
3 files changed +36
-16
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -e
3
3
4
+ CI_BRANCH=" $1 "
4
5
CI_BRANCH=" $1 "
5
6
CI_JSDEC=" $PWD "
6
- CI_RZ_VERSION=$( curl -s GET https://api.github.com/repos/rizinorg/rizin/tags\? per_page\= 1 | jq -r ' .[].name' )
7
+ CI_RZ_VERSION=$2
8
+
9
+ if [ " $2 " != " dev" ]; then
10
+ # master branch always build against latest release of rizin
11
+ CI_RZ_VERSION=$( curl -s GET https://api.github.com/repos/rizinorg/rizin/tags\? per_page\= 1 | jq -r ' .[].name' )
12
+ fi
7
13
8
14
echo " CI_BRANCH: $CI_BRANCH "
9
15
echo " CI_RZ_VERSION: $CI_RZ_VERSION "
@@ -12,11 +18,19 @@ echo "CI_JSDEC: $CI_JSDEC"
12
18
# avoid placing rizin in the same folder.
13
19
cd ..
14
20
15
- # download the latest tagged rizin version and install it
16
- wget -O " rizin.tar.xz" " https://github.com/rizinorg/rizin/releases/download/$CI_RZ_VERSION /rizin-src-$CI_RZ_VERSION .tar.xz"
17
- tar xf " rizin.tar.xz"
18
- cd " rizin-$CI_RZ_VERSION "
21
+ # download rizin
22
+ if [ " $CI_RZ_VERSION " == " dev" ]; then
23
+ # dev branch always build against latest commit of rizin
24
+ wget -O " rizin.tar.gz" " https://github.com/rizinorg/rizin/archive/refs/heads/dev.tar.gz"
25
+ tar xf " rizin.tar.gz"
26
+ else
27
+ # master branch always build against latest release of rizin
28
+ wget -O " rizin.tar.xz" " https://github.com/rizinorg/rizin/releases/download/$CI_RZ_VERSION /rizin-src-$CI_RZ_VERSION .tar.xz"
29
+ tar xf " rizin.tar.xz"
30
+ fi
19
31
32
+ # build rizin and install it.
33
+ cd " rizin-$CI_RZ_VERSION "
20
34
meson setup --buildtype=release -Denable_tests=false build
21
35
sudo ninja -C build install
22
36
Original file line number Diff line number Diff line change 4
4
import os
5
5
6
6
file_name = sys .argv [1 ]
7
+ latest = "master" if len (sys .argv ) < 2 else sys .argv [2 ]
8
+
7
9
_ , file_extension = os .path .splitext (file_name )
8
10
out_file = f"rizin{ file_extension } "
9
11
print (file_name , out_file )
10
12
11
- tags = None
12
- with urllib .request .urlopen ('https://api.github.com/repos/rizinorg/rizin/tags?per_page=1' ) as f :
13
- tags = json .load (f )
14
- latest = tags [0 ]['name' ]
15
-
16
- url = f"https://github.com/rizinorg/rizin/releases/download/{ latest } /{ file_name } "
17
- url = url .format (version = latest )
13
+ if latest != "dev" :
14
+ # master branch always build against latest release of rizin
15
+ tags = None
16
+ with urllib .request .urlopen ('https://api.github.com/repos/rizinorg/rizin/tags?per_page=1' ) as f :
17
+ tags = json .load (f )
18
+ latest = tags [0 ]['name' ]
19
+ url = f"https://github.com/rizinorg/rizin/releases/download/{ latest } /{ file_name } "
20
+ url = url .format (version = latest )
21
+ else :
22
+ # dev branch always build against latest commit of rizin
23
+ url = "https://github.com/rizinorg/rizin/archive/refs/heads/dev.zip"
18
24
19
- print (f"Latest rizin tag : { latest } " )
25
+ print (f"Using rizin branch : { latest } " )
20
26
print (f"{ url } as { out_file } " )
21
27
22
28
urllib .request .urlretrieve (url , out_file )
Original file line number Diff line number Diff line change 21
21
- name : Install dependencies
22
22
run : sudo apt -y install meson ninja-build
23
23
- name : Build & run the plugin
24
- run : bash .ci-scripts/ci-build-linux.sh "${{ github.ref_name }}"
24
+ run : bash .ci-scripts/ci-build-linux.sh "${{ github.event.pull_request.base.ref || github. ref_name }}"
25
25
26
26
windows-64 :
27
27
runs-on : windows-latest
52
52
run : |
53
53
WORKDIR="$PWD"
54
54
cd ..
55
- python "$WORKDIR/.ci-scripts/ci-rizin-dl.py" 'rizin-${{ matrix.release }}-{version}.zip'
56
- unzip rizin.zip
55
+ python "$WORKDIR/.ci-scripts/ci-rizin-dl.py" 'rizin-${{ matrix.release }}-{version}.zip' '${{ github.event.pull_request.base.ref || github.ref_name }}'
56
+ unzip -q rizin.zip
57
57
rm *.zip
58
58
mv rizin* rizin
59
59
cd "$WORKDIR"
You can’t perform that action at this time.
0 commit comments