windows: use system curl #35
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
name: CI | |
on: push | |
env: | |
DOWNLOAD_TOOL: curl -fLOSs --retry 2 --retry-delay 60 | |
jobs: | |
windows: | |
strategy: | |
matrix: | |
include: | |
- type: RelWithDebInfo | |
name: Windows ${{ matrix.type }} | |
runs-on: windows-2019 | |
env: | |
BUILD_TYPE: ${{ matrix.type }} | |
steps: | |
- name: Checkout Source Code | |
uses: actions/checkout@v3 | |
with: | |
path: 'crashpad/crashpad' | |
- name: Enable Developer Command Prompt (Windows) | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Create install destination | |
shell: bash | |
run: | | |
mkdir -p $GITHUB_WORKSPACE/install | |
echo "INSTALL_DIR=$GITHUB_WORKSPACE/install" >> $GITHUB_ENV | |
- name: Build | |
shell: cmd | |
working-directory: ${{ runner.workspace }} | |
run: | | |
mkdir "%INSTALL_DIR%/bin" | |
curl -fsSL http://hg.mozilla.org/build/tools/raw-file/755e58ebc9d4/breakpad/win32/minidump_stackwalk.exe -o "%INSTALL_DIR%/bin/minidump_stackwalk.exe" | |
curl -fsSL http://hg.mozilla.org/build/tools/raw-file/755e58ebc9d4/breakpad/win32/cygwin1.dll -o "%INSTALL_DIR%/bin/cygwin1.dll" | |
curl -fsSL http://hg.mozilla.org/build/tools/raw-file/755e58ebc9d4/breakpad/win32/cygstdc++-6.dll -o "%INSTALL_DIR%/bin/cygstdc++-6.dll" | |
curl -fsSL http://hg.mozilla.org/build/tools/raw-file/755e58ebc9d4/breakpad/win32/cyggcc_s-1.dll -o "%INSTALL_DIR%/bin/cyggcc_s-1.dll" | |
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git | |
set PATH=%cd%\depot_tools;%PATH% | |
cd crashpad | |
cmd /c gclient config https://github.com/olive-editor/crashpad.git | |
cmd /c gclient sync | |
cd crashpad | |
cmd /c gn gen out/Default --args="extra_cflags=\"/MD\" extra_ldflags=\"shlwapi.lib\"" | |
ninja -C out/Default | |
mkdir "%INSTALL_DIR%/crashpad" | |
xcopy /s *.h "%INSTALL_DIR%/crashpad" | |
xcopy /s *.lib "%INSTALL_DIR%/crashpad" | |
xcopy /s *.exe "%INSTALL_DIR%/crashpad" | |
- name: Start SSH session | |
uses: luchihoratiu/debug-via-ssh@main | |
with: | |
NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} | |
SSH_PASS: ${{ secrets.SSH_PASS }} | |
- name: Deploy | |
shell: bash | |
working-directory: ${{ runner.workspace }} | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
# Force using system curl rather than msys's | |
PATH=/c/Windows/system32:$PATH | |
cd $INSTALL_DIR/.. | |
$DOWNLOAD_TOOL https://github.com/probonopd/uploadtool/raw/master/upload.sh | |
tar czf "crashpad-win32-$BUILD_TYPE.tar.gz" $(cygpath "install") | |
./upload.sh "crashpad-win32-$BUILD_TYPE.tar.gz" | |
mac: | |
strategy: | |
matrix: | |
include: | |
- arch: x86_64 | |
os: macos-11.0 | |
- arch: arm64 | |
os: macos-11.0 | |
name: macOS (${{ matrix.arch }}) | |
runs-on: ${{ matrix.os }} | |
env: | |
CFLAGS: "-mmacosx-version-min=10.13 -arch ${{ matrix.arch }}" | |
CXXFLAGS: "-mmacosx-version-min=10.13 -arch ${{ matrix.arch }}" | |
CPPFLAGS: "-mmacosx-version-min=10.13 -arch ${{ matrix.arch }}" | |
LDFLAGS: "-mmacosx-version-min=10.13 -arch ${{ matrix.arch }}" | |
MACOSX_DEPLOYMENT_TARGET: 10.13 | |
BUILD_TYPE: ${{ matrix.type }} | |
steps: | |
- name: Checkout Source Code | |
uses: actions/checkout@v3 | |
with: | |
path: 'crashpad/crashpad' | |
- name: Create install destination | |
shell: bash | |
run: | | |
sudo mkdir /opt/olive-editor | |
sudo chmod 777 /opt/olive-editor | |
echo "INSTALL_DIR=/opt/olive-editor" >> $GITHUB_ENV | |
- name: Set up Homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Install Ninja | |
shell: bash | |
run: | | |
brew install ninja | |
- name: Build | |
shell: bash | |
working-directory: ${{ runner.workspace }} | |
run: | | |
git clone https://chromium.googlesource.com/breakpad/breakpad | |
cd breakpad | |
git checkout 652e7dac80f7a97c69818b928830850bfd1cf0f8 | |
if [ "${{ matrix.arch }}" == "arm64" ] | |
then | |
HOST=aarch64 | |
else | |
HOST=x86_64 | |
fi | |
./configure --host=$HOST-apple-darwin | |
make | |
mkdir "$INSTALL_DIR/bin" | |
cp src/processor/minidump_stackwalk "$INSTALL_DIR/bin" | |
# Don't build for arm64, dump_syms runs on the host so it should stay x86_64 | |
xcodebuild -project src/tools/mac/dump_syms/dump_syms.xcodeproj #-arch ${{ matrix.arch }} | |
cp src/tools/mac/dump_syms/build/Release/dump_syms "$INSTALL_DIR/bin" | |
cd .. | |
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git | |
export PATH=$(pwd)/depot_tools:$PATH | |
cd crashpad | |
gclient config https://github.com/olive-editor/crashpad.git | |
gclient sync | |
cd crashpad | |
if [ "${{ matrix.arch }}" == "arm64" ] | |
then | |
CPU=arm64 | |
else | |
CPU=x64 | |
fi | |
gn gen out/Default "--args=target_cpu=\"$CPU\"" | |
ninja -C out/Default | |
mkdir "$INSTALL_DIR/crashpad" | |
rsync -ra --include "*/" --include "*.h" --include "*.a" --include "out/Default/obj/out/Default/gen/util/mach/*.o" --exclude "*.*" . "$INSTALL_DIR/crashpad" | |
- name: Deploy | |
shell: bash | |
working-directory: ${{ runner.workspace }} | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
$DOWNLOAD_TOOL https://github.com/probonopd/uploadtool/raw/master/upload.sh | |
tar czf "crashpad-mac-${{ matrix.arch }}.tar.gz" "/opt/olive-editor" | |
chmod +x upload.sh | |
./upload.sh "crashpad-mac-${{ matrix.arch }}.tar.gz" |