Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tihmstar authored Jan 4, 2020
1 parent 542a470 commit 120447d
Showing 1 changed file with 10 additions and 27 deletions.
37 changes: 10 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
env:
BUILDROOT: "buildroot_${{ matrix.platform }}"
GIT_DEPENDENCIES: tihmstar/libgeneral


steps:
- uses: actions/checkout@v1
Expand All @@ -25,7 +24,7 @@ jobs:
sudo apt-get install -y libssl-dev libcurl4-openssl-dev libzip-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install autoconf automake libtool openssl pkg-config libzip
brew install autoconf automake libtool pkg-config libzip
else
echo "$RUNNER_OS not supported"
Expand All @@ -41,6 +40,9 @@ jobs:
grep '"tag_name":' | # Get tag line
rev | cut -d '"' -f2 | rev # Pluck JSON value
}
mkdir depdir
cd depdir
mkdir $BUILDROOT
IFS=',' read -r -a deparray <<< "$GIT_DEPENDENCIES"; for d in ${deparray[@]}; do
echo "Got dependency: $d"
r=$(echo $d | cut -d '/' -f 2)
Expand All @@ -51,35 +53,16 @@ jobs:
unzip -u "$BUILDROOT.zip"
rm "$BUILDROOT.zip"
done
echo "moving dependencies to /"
sudo cp -r $BUILDROOT/* /
cd ..
rm -rf depdir
- name: autogen
run: |
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$GITHUB_WORKSPACE/$BUILDROOT/lib/pkgconfig
export CFLAGS="-I$GITHUB_WORKSPACE/$BUILDROOT/include"
export LDFLAGS="-L$GITHUB_WORKSPACE/$BUILDROOT/lib"
IFS=',' read -r -a deparray <<< "$GIT_DEPENDENCIES"; for d in ${deparray[@]}; do
echo "Got dependency: $d"
r=$(echo $d | cut -d '/' -f 2)
echo "Set $r pkg-config prefix var"
export $(echo "PKG_CONFIG_$(echo $r | tr a-z A-Z)_PREFIX")=$GITHUB_WORKSPACE/$BUILDROOT
done
./autogen.sh --enable-static --disable-shared --prefix=$GITHUB_WORKSPACE/$BUILDROOT
run: ./autogen.sh --enable-static --disable-shared
- name: make
run: make
- name: make install
run: |
echo "get depfiles list"
oldfiles=$(find $GITHUB_WORKSPACE/$BUILDROOT | tr '\n' ',')
make install
echo "remove depfiles files"
IFS=',' read -r -a deplist <<< "$oldfiles"; for f in ${deplist[@]}; do
echo "deleting file $f"
rm -f $f 2>/dev/null && echo "ok" || echo "failed"
done
echo "remove depfiles dirs"
IFS=',' read -r -a deplist <<< "$oldfiles"; for f in ${deplist[@]}; do
echo "deleting directory $f"
rmdir $f 2>/dev/null && echo "ok" || echo "failed"
done
run: make DESTDIR=$GITHUB_WORKSPACE/$BUILDROOT install
- uses: actions/upload-artifact@v1
with:
name: ${{ env.BUILDROOT }}
Expand Down

0 comments on commit 120447d

Please sign in to comment.