Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit 336d799

Browse files
jeffreyhansonjeroen
authored andcommitted
add ci script
1 parent 98fee41 commit 336d799

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

.github/workflows/bundle.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#/bin/sh
2+
set -e
3+
PACKAGE=coinor-cbc
4+
5+
# Update
6+
pacman -Sy
7+
OUTPUT=$(mktemp -d)
8+
9+
pkgs=$(echo mingw-w64-{i686,x86_64,ucrt-x86_64}-${PACKAGE})
10+
URLS=$(pacman -Sp $pkgs --cache=$OUTPUT)
11+
VERSION=$(pacman -Si mingw-w64-x86_64-${PACKAGE} | awk '/^Version/{print $3}')
12+
13+
# Set version for next step
14+
echo "::set-output name=VERSION::${VERSION}"
15+
echo "::set-output name=PACKAGE::${PACKAGE}"
16+
echo "Bundling $PACKAGE-$VERSION"
17+
echo "# $PACKAGE $VERSION" > README.md
18+
echo "" >> README.md
19+
20+
for URL in $URLS; do
21+
curl -OLs $URL
22+
FILE=$(basename $URL)
23+
echo "Extracting: $FILE"
24+
echo " - $FILE" >> readme.md
25+
tar xf $FILE -C ${OUTPUT}
26+
unlink $FILE
27+
done
28+
29+
# Put into dir structure
30+
rm -Rf lib lib-8.3.0 lib-4.9.3 include share
31+
mkdir -p lib lib-8.3.0
32+
cp -Rf ${OUTPUT}/mingw64/include .
33+
cp -Rf ${OUTPUT}/mingw64/share .
34+
cp -Rf ${OUTPUT}/mingw64/lib lib-8.3.0/x64
35+
cp -Rf ${OUTPUT}/mingw32/lib lib-8.3.0/i386
36+
cp -Rf ${OUTPUT}/ucrt64/lib lib/x64
37+
38+
# Cleanup
39+
rm -Rf ${OUTPUT}

.github/workflows/bundle.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: bundle binaries
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
runs-on: windows-latest
9+
steps:
10+
- name: Prepare git
11+
run: |
12+
git config --global core.autocrlf false
13+
git config --global user.email '121622595+jeroen[bot]@users.noreply.github.com'
14+
git config --global user.name 'Jeroen (via CI)'
15+
- uses: actions/checkout@v2
16+
- id: download
17+
name: Download libraries
18+
run: |
19+
cd $(cygpath ${GITHUB_WORKSPACE})
20+
.github/workflows/bundle.sh
21+
shell: c:\rtools40\usr\bin\bash.exe --login {0}
22+
- name: Push binaries
23+
run: |
24+
version=${{ steps.download.outputs.VERSION }}
25+
git add README.md include share lib*
26+
git commit -a -m "Bundle $version ($(date +%F))" || exit 0
27+
git tag $version
28+
git push origin master $version
29+
shell: bash

0 commit comments

Comments
 (0)