Fix a silly bug in the shift to support Apple Silicon #18
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: macOS builds | |
on: push | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build-anisette-server-macOS-x86_64: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: dlang-community/setup-dlang@v1 | |
with: | |
compiler: ldc-1.33.0 | |
- name: Set-up macOS cross-compilation | |
run: | | |
mkdir -p $HOME/.ldc/ | |
curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz | |
tar -xf ./MacOSX11.0.sdk.tar.xz -C $HOME | |
cat << EOF | tee $HOME/.ldc/ldc2.conf | |
"x86_64-apple-darwin": | |
{ | |
// default switches injected before all explicit command-line switches | |
switches = [ | |
"-gcc=clang", | |
"-linker=lld", | |
"-Xcc=-target", | |
"-Xcc=x86_64-apple-darwin", | |
"-Xcc=-isysroot", | |
"-Xcc=$HOME/MacOSX11.0.sdk", | |
"-defaultlib=phobos2-ldc,druntime-ldc", | |
]; | |
// default switches appended after all explicit command-line switches | |
post-switches = [ | |
"-I$HOME/ldc2-1.33.0-osx-x86_64/import", | |
]; | |
// default directories to be searched for libraries when linking | |
lib-dirs = [ | |
"$HOME/ldc2-1.33.0-osx-x86_64/lib", | |
]; | |
}; | |
EOF | |
mkdir $HOME/ldc-macos | |
curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.33.0/ldc2-1.33.0-osx-x86_64.tar.xz | |
tar -xf ./ldc2-1.33.0-osx-x86_64.tar.xz -C $HOME | |
- name: Build | |
run: dub build :anisette-server -b release-debug -c "static" --arch=x86_64-apple-darwin | |
- name: Rename | |
run: | | |
mv "${{github.workspace}}/bin/provision_anisette-server" "${{github.workspace}}/bin/anisette-server-macOS-x86_64" | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: anisette-server-macOS-x86_64 | |
path: | | |
${{github.workspace}}/bin/anisette-server-macOS-x86_64 | |
build-anisette-server-macOS-arm64: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/checkout@v2 | |
- uses: dlang-community/setup-dlang@v1 | |
with: | |
compiler: ldc-1.33.0 | |
- name: Set-up macOS cross-compilation | |
run: | | |
mkdir -p $HOME/.ldc/ | |
curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz | |
tar -xf ./MacOSX11.0.sdk.tar.xz -C $HOME | |
cat << EOF | tee $HOME/.ldc/ldc2.conf | |
"arm64-apple-macos": | |
{ | |
// default switches injected before all explicit command-line switches | |
switches = [ | |
"-gcc=clang", | |
"-linker=lld", | |
"-Xcc=-target", | |
"-Xcc=arm64-apple-macos", | |
"-Xcc=-isysroot", | |
"-Xcc=$HOME/MacOSX11.0.sdk", | |
"-defaultlib=phobos2-ldc,druntime-ldc", | |
]; | |
// default switches appended after all explicit command-line switches | |
post-switches = [ | |
"-I$HOME/ldc2-1.33.0-osx-arm64/import", | |
]; | |
// default directories to be searched for libraries when linking | |
lib-dirs = [ | |
"$HOME/ldc2-1.33.0-osx-arm64/lib", | |
]; | |
}; | |
EOF | |
mkdir $HOME/ldc-macos | |
curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.33.0/ldc2-1.33.0-osx-arm64.tar.xz | |
tar -xf ./ldc2-1.33.0-osx-arm64.tar.xz -C $HOME | |
- name: Build | |
run: dub build :anisette-server -b release-debug -c "static" --arch=arm64-apple-macos | |
- name: Rename | |
run: | | |
mv "${{github.workspace}}/bin/provision_anisette-server" "${{github.workspace}}/bin/anisette-server-macOS-arm64" | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: anisette-server-macOS-arm64 | |
path: | | |
${{github.workspace}}/bin/anisette-server-macOS-arm64 |