Skip to content

Commit 183300a

Browse files
committed
Auto-build docs
1 parent a614d02 commit 183300a

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

.github/workflows/build-deploy.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ jobs:
5050
php-version: '7.4'
5151
extensions: intl-69.1
5252

53+
- name: Install additional packages 🏗
54+
shell: bash
55+
run: |
56+
sudo apt-get -y update
57+
sudo apt-get -y install doxygen
58+
5359
- name: Install composer dependencies 🏗
5460
shell: bash
5561
run: |
@@ -60,11 +66,90 @@ jobs:
6066
run: |
6167
npm install
6268
69+
- name: Get libimobiledevice releases
70+
uses: yakubique/[email protected]
71+
id: get_releases_libimobiledevice
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
with:
75+
repository: libimobiledevice/libimobiledevice
76+
77+
- name: Get libplist releases
78+
uses: yakubique/[email protected]
79+
id: get_releases_libplist
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
with:
83+
repository: libimobiledevice/libplist
84+
6385
- name: Build 🔧
6486
shell: bash
6587
run: |
6688
make production
6789
90+
- name: Build libimobiledevice documentation
91+
shell: bash
92+
run: |
93+
PACKAGE=libimobiledevice
94+
CURDIR=`pwd`
95+
curl -o $PACKAGE-master.zip -Ls https://github.com/libimobiledevice/$PACKAGE/archive/refs/heads/master.zip
96+
unzip $PACKAGE-master.zip
97+
for I in `echo '${{ steps.get_releases_libimobiledevice.outputs.releases }}' |jq -r '.[]'`; do
98+
echo Downloading https://github.com/libimobiledevice/$PACKAGE/releases/download/$I/$PACKAGE-$I.tar.bz2
99+
RES=`curl -L -s -o /dev/null -I -w "%{http_code}" https://github.com/libimobiledevice/$PACKAGE/releases/download/$I/$PACKAGE-$I.tar.bz2`
100+
if test "$RES" = "200"; then
101+
curl -o $PACKAGE-$I.tar.bz2 -Ls https://github.com/libimobiledevice/$PACKAGE/releases/download/$I/$PACKAGE-$I.tar.bz2
102+
tar xjf $PACKAGE-$I.tar.bz2
103+
else
104+
curl -o $PACKAGE-$I.tar.gz -Ls https://github.com/libimobiledevice/$PACKAGE/archive/refs/tags/$I.tar.gz
105+
tar xzf $PACKAGE-$I.tar.gz
106+
fi
107+
cd $PACKAGE-$I
108+
sed -e s/@PACKAGE@/$PACKAGE/g -e s/@VERSION@/$I/g < ../$PACKAGE-master/doxygen.cfg.in > doxygen.cfg
109+
if ! test -d docs/doxygen; then
110+
cp -r ../$PACKAGE-master/docs/doxygen docs/
111+
fi
112+
echo "Building docs for $PACKAGE-$I..."
113+
doxygen doxygen.cfg
114+
cd $CURDIR
115+
mkdir -p public/docs/$PACKAGE/$I
116+
cp -r $PACKAGE-$I/docs/html/* public/docs/$PACKAGE/$I/
117+
ln -s -f $I public/docs/$PACKAGE/latest
118+
ls -l public/docs/$PACKAGE
119+
done
120+
121+
- name: Build libplist documentation
122+
shell: bash
123+
run: |
124+
PACKAGE=libplist
125+
CURDIR=`pwd`
126+
curl -o $PACKAGE-master.zip -Ls https://github.com/libimobiledevice/$PACKAGE/archive/refs/heads/master.zip
127+
unzip $PACKAGE-master.zip
128+
for I in `echo '${{ steps.get_releases_libplist.outputs.releases }}' |jq -r '.[]'`; do
129+
echo Downloading https://github.com/libimobiledevice/$PACKAGE/releases/download/$I/$PACKAGE-$I.tar.bz2
130+
RES=`curl -L -s -o /dev/null -I -w "%{http_code}" https://github.com/libimobiledevice/$PACKAGE/releases/download/$I/$PACKAGE-$I.tar.bz2`
131+
if test "$RES" = "200"; then
132+
curl -o $PACKAGE-$I.tar.bz2 -Ls https://github.com/libimobiledevice/$PACKAGE/releases/download/$I/$PACKAGE-$I.tar.bz2
133+
tar xjf $PACKAGE-$I.tar.bz2
134+
else
135+
curl -o $PACKAGE-$I.tar.gz -Ls https://github.com/libimobiledevice/$PACKAGE/archive/refs/tags/$I.tar.gz
136+
tar xzf $PACKAGE-$I.tar.gz
137+
fi
138+
cd $PACKAGE-$I
139+
sed -e s/@PACKAGE@/$PACKAGE/g -e s/@VERSION@/$I/g < ../$PACKAGE-master/doxygen.cfg.in > doxygen.cfg
140+
if ! test -d docs/doxygen; then
141+
cp -r ../$PACKAGE-master/docs/doxygen docs/
142+
fi
143+
echo "Building docs for $PACKAGE-$I..."
144+
doxygen doxygen.cfg
145+
cd $CURDIR
146+
mkdir -p public/docs/$PACKAGE/$I
147+
cp -r $PACKAGE-$I/docs/html/* public/docs/$PACKAGE/$I/
148+
ln -s -f $I public/docs/$PACKAGE/latest
149+
ls -l public/docs/$PACKAGE/
150+
done
151+
152+
68153
- name: Deploy 🚀
69154
uses: JamesIves/[email protected]
70155
with:

0 commit comments

Comments
 (0)