-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Github Actions workflow for macOS snapshot build
- Loading branch information
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: macos-snapshot | ||
|
||
on: | ||
push: | ||
branches: | ||
- "*-macos" | ||
schedule: | ||
- cron: "30 6 * * 0,1,3,5,6" | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
env: | ||
OPENSCAD_LIBRARIES: /Users/runner/work/openscad/libraries/install/ | ||
LIBRARIES_CACHE: libraries.tar.gz | ||
steps: | ||
- name: Checkout OpenSCAD | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: 'recursive' | ||
- name: Install Homebrew packages | ||
run: | | ||
brew update | ||
brew install automake | ||
- name: Cache Libraries | ||
id: cache-libraries | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.OPENSCAD_LIBRARIES }} | ||
key: ${{ runner.os }}-libraries-${{ hashFiles('./scripts/macosx-build-dependencies.sh', '.github/workflows/macos-release.yml') }} | ||
restore-keys: ${{ runner.os }}-libraries- | ||
- name: Build Dependencies | ||
run: | | ||
export PKG_CONFIG_PATH="$OPENSCAD_LIBRARIES/lib/pkgconfig" | ||
export DYLD_LIBRARY_PATH="$OPENSCAD_LIBRARIES/lib" | ||
export DYLD_FRAMEWORK_PATH="$OPENSCAD_LIBRARIES/lib" | ||
echo "PWD = $CI_BASEDIR" | ||
echo "PATH = $PATH" | ||
echo "DYLD_LIBRARY_PATH: $DYLD_LIBRARY_PATH" | ||
# Pick up our own Qt | ||
export PATH=$OPENSCAD_LIBRARIES/bin:$PATH | ||
./scripts/macosx-build-dependencies.sh -d double_conversion eigen gmp mpfr glew gettext libffi freetype ragel harfbuzz libz libzip libxml2 fontconfig hidapi libuuid lib3mf poppler pixman cairo glib2 boost cgal qt5 opencsg qscintilla sparkle | ||
- name: Package Dependencies as an artifact | ||
run: | | ||
mkdir -p ${{ runner.temp }}/out | ||
tar cz -C "$OPENSCAD_LIBRARIES" -f ${{ runner.temp }}/out/"$LIBRARIES_CACHE" . | ||
shasum -a 512 ${{ runner.temp }}/out/"$LIBRARIES_CACHE" > ${{ runner.temp }}/out/"$LIBRARIES_CACHE".sha512 | ||
- name: Build OpenSCAD | ||
run: | | ||
echo "Start building OpenSCAD: $(date)" | ||
export PKG_CONFIG_PATH="$OPENSCAD_LIBRARIES/lib/pkgconfig" | ||
export DYLD_LIBRARY_PATH="$OPENSCAD_LIBRARIES/lib" | ||
export DYLD_FRAMEWORK_PATH="$OPENSCAD_LIBRARIES/lib" | ||
export NUMCPU=$(($(sysctl -n hw.ncpu) * 3 / 2)) | ||
time ./scripts/release-common.sh -snapshot | ||
cd build | ||
OPENSCAD_NAME=$(ls OpenSCAD-*.dmg) | ||
shasum -a 256 "$OPENSCAD_NAME" > "$OPENSCAD_NAME".sha256 | ||
shasum -a 512 "$OPENSCAD_NAME" > "$OPENSCAD_NAME".sha512 | ||
cp -v "$OPENSCAD_NAME"* ${{ runner.temp }}/out/ | ||
echo "Finished building OpenSCAD: $(date)" | ||
- name: Verify OpenSCAD binary | ||
run: | | ||
./scripts/macosx-sanity-check.py ./build/OpenSCAD.app/Contents/MacOS/OpenSCAD | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Build Artifacts | ||
path: ${{ runner.temp }}/out/ |