@@ -11,115 +11,102 @@ jobs:
11
11
runs-on : ${{ matrix.platform }}
12
12
env :
13
13
BUILDROOT : " buildroot_${{ matrix.platform }}"
14
- GIT_DEPENDENCIES : tihmstar/ libgeneral
15
- MAC_DYNAMIC_LIBS : openssl,libplist
16
-
14
+ GIT_DEPENDENCIES : libgeneral,libplist
15
+ MAC_DYNAMIC_LIBS : openssl
16
+
17
17
steps :
18
- - uses : actions/checkout@v1
19
- - name : prepre buildroot
20
- run : mkdir $BUILDROOT
18
+ - uses : actions/checkout@v4
19
+ with :
20
+ fetch-depth : 0
21
21
- name : Install pre-dependencies
22
- run : |
22
+ run : |
23
23
if [ "$RUNNER_OS" == "Linux" ]; then
24
- sudo apt-get install -y libssl-dev
25
-
26
- # install liblzfse
27
- git clone https://github.com/lzfse/lzfse.git
28
- make -C lzfse CFLAGS="-fPIC"
29
- make -C lzfse INSTALL_PREFIX=$GITHUB_WORKSPACE/$BUILDROOT install
30
- sudo make -C lzfse install
31
- rm -rf lzfse
32
-
33
- #install libplist-2.0 because libplist-dev is called "libplist v2.0.0"
34
- git clone https://github.com/libimobiledevice/libplist
35
- cd libplist
36
- ./autogen.sh --without-cython --enable-static --disable-shared CFLAGS="-fPIC" CXXFLAGS="-fPIC"
37
- make
38
- sudo make install
39
- cd ..
40
- rm -rf libplist
41
-
24
+ sudo apt-get update
25
+ sudo apt-get install -y jq libssl-dev
26
+
27
+ # install liblzfse
28
+ git clone https://github.com/lzfse/lzfse.git
29
+ make -C lzfse CFLAGS="-fPIC"
30
+ make -C lzfse INSTALL_PREFIX=$GITHUB_WORKSPACE/$BUILDROOT install
31
+ sudo make -C lzfse install
32
+ rm -rf lzfse
33
+
42
34
elif [ "$RUNNER_OS" == "macOS" ]; then
43
- brew install autoconf automake libtool pkg-config openssl libplist
44
-
45
- cd $(brew --prefix openssl)
46
- sudo cp -r lib/pkgconfig/* /usr/local/lib/pkgconfig/
47
- cd $GITHUB_WORKSPACE
48
-
35
+ brew install autoconf automake libtool jq pkg-config
36
+ brew install openssl
37
+
38
+ cd $(brew --prefix openssl)
39
+ sudo cp -r lib/pkgconfig/* /usr/local/lib/pkgconfig/
40
+
41
+ IFS=',' read -r -a deparray <<< "$MAC_DYNAMIC_LIBS"; for d in ${deparray[@]}; do
42
+ echo "moving library $d"
43
+ cd $(brew --prefix $d)
44
+ find . -name "*.dylib" -exec mv {} {}.bak \;
45
+ done
46
+ cd $GITHUB_WORKSPACE
47
+
49
48
else
50
- echo "$RUNNER_OS not supported"
51
- exit 1
49
+ echo "$RUNNER_OS not supported"
50
+ exit 1
52
51
fi
53
52
shell : bash
54
53
- name : download dependencies
55
54
env :
56
55
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
57
56
run : |
58
57
get_latest_release() {
59
- curl --silent --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
60
- grep '"tag_name":' | # Get tag line
61
- rev | cut -d '"' -f2 | rev # Pluck JSON value
58
+ url="https://api.github.com/repos/$1/releases/latest"
59
+ echo "url: ${url}" >&2
60
+ curl --silent --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "${url}" | # Get latest release from GitHub api
61
+ jq .tag_name | # Get tag
62
+ tr -d '"' # Strip quotes
62
63
}
63
64
mkdir depdir
64
65
cd depdir
65
66
mkdir $BUILDROOT
66
- IFS=',' read -r -a deparray <<< "$GIT_DEPENDENCIES"; for d in ${deparray[@]}; do
67
- echo "Got dependency: $d"
68
- r=$(echo $d | cut -d '/' -f 2)
69
- echo "Got reponame: $r"
70
- tag=$(get_latest_release $d);
67
+ IFS=',' read -r -a deparray <<< "$GIT_DEPENDENCIES"; for d in ${deparray[@]}; do
68
+ dep=$d
69
+ if ! echo ${dep} | grep -q '/'; then
70
+ dep=${{ github.repository_owner }}/${dep}
71
+ fi
72
+ echo "Got dependency: ${dep}"
73
+ tag=$(get_latest_release ${dep});
71
74
echo "Found tag: $tag"
72
- wget "https://github.com/$d /releases/download/$tag/$BUILDROOT.zip"
75
+ wget "https://github.com/${dep} /releases/download/$tag/$BUILDROOT.zip"
73
76
unzip -u "$BUILDROOT.zip"
74
77
rm "$BUILDROOT.zip"
75
78
done
76
79
echo "moving dependencies to /"
77
80
sudo cp -r $BUILDROOT/* /
78
81
cd ..
79
82
rm -rf depdir
83
+ - name : prepre buildroot
84
+ run : mkdir -p $BUILDROOT
80
85
- name : autogen
81
86
run : ./autogen.sh --enable-static --disable-shared
82
87
- name : make
83
- run : |
84
- if [ "$RUNNER_OS" == "macOS" ]; then
85
- IFS=',' read -r -a deparray <<< "$MAC_DYNAMIC_LIBS"; for d in ${deparray[@]}; do
86
- echo "moving library $d"
87
- cd $(brew --prefix $d)
88
- find . -name "*.dylib" -exec mv {} {}.bak \;
89
- done
90
- cd $GITHUB_WORKSPACE
91
-
92
- make
93
-
94
- IFS=',' read -r -a deparray <<< "$MAC_DYNAMIC_LIBS"; for d in ${deparray[@]}; do
95
- echo "restoring library $d"
96
- cd $(brew --prefix $d)
97
- find . -name "*.dylib.bak" | while read f; do o=$(echo $f | rev | cut -d '.' -f2- | rev); mv $f $o; done
98
- done
99
- cd $GITHUB_WORKSPACE
100
- else
101
- make
102
- fi
88
+ run : make -j || make
103
89
- name : make install
104
- run : make DESTDIR=$GITHUB_WORKSPACE/$BUILDROOT install
105
- - uses : actions/upload-artifact@v1
90
+ run : make DESTDIR=$GITHUB_WORKSPACE/$BUILDROOT install
91
+ - uses : actions/upload-artifact@v4
106
92
with :
107
93
name : ${{ env.BUILDROOT }}
108
94
path : ${{ env.BUILDROOT }}
109
95
110
96
release :
111
97
needs : build
112
98
runs-on : ubuntu-latest
113
-
114
99
steps :
115
- - uses : actions/checkout@v1
100
+ - uses : actions/checkout@v4
101
+ with :
102
+ fetch-depth : 0
116
103
- name : Download ubuntu artifact
117
- uses : actions/download-artifact@v1
104
+ uses : actions/download-artifact@v4
118
105
with :
119
106
name : buildroot_ubuntu-latest
120
107
path : buildroot_ubuntu-latest
121
108
- name : Download macos artifact
122
- uses : actions/download-artifact@v1
109
+ uses : actions/download-artifact@v4
123
110
with :
124
111
name : buildroot_macos-latest
125
112
path : buildroot_macos-latest
@@ -133,33 +120,16 @@ jobs:
133
120
zip -r buildroot_ubuntu-latest.zip buildroot_ubuntu-latest
134
121
- name : Create Release
135
122
id : create_release
136
-
123
+ uses : softprops/action-gh-release@v2
124
+ if : github.ref == 'refs/heads/master'
137
125
env :
138
126
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
139
127
with :
128
+ prerelease : false
129
+ draft : false
140
130
tag_name : ${{ env.BUILD_VERSION_NUM }}
141
- release_name : Build ${{ env.BUILD_VERSION_STR }}
131
+ name : Build ${{ env.BUILD_VERSION_STR }}
142
132
body : ${{ env.COMMIT_MSG }}
143
- draft : false
144
- prerelease : false
145
- - name : Upload Release Asset ubuntu
146
- id : upload-release-asset-ubuntu
147
-
148
- env :
149
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
150
- with :
151
- upload_url : ${{ steps.create_release.outputs.upload_url }}
152
- asset_path : buildroot_ubuntu-latest.zip
153
- asset_name : buildroot_ubuntu-latest.zip
154
- asset_content_type : application/zip
155
- - name : Upload Release Asset macos
156
- id : upload-release-asset-macos
157
-
158
- env :
159
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
160
- with :
161
- upload_url : ${{ steps.create_release.outputs.upload_url }}
162
- asset_path : buildroot_macos-latest.zip
163
- asset_name : buildroot_macos-latest.zip
164
- asset_content_type : application/zip
165
-
133
+ files : |
134
+ buildroot_ubuntu-latest.zip
135
+ buildroot_macos-latest.zip
0 commit comments