Skip to content

move

move #34

Workflow file for this run

name: MacOS
on: [push, pull_request,repository_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
macos:
name: MacOS Release
runs-on: macos-latest
strategy:
matrix:
# Add commits/tags to build against other DuckDB versions
duckdb_version: [ '<submodule_version>' ]
# Universal build (OSX_BUILD_UNIVERSAL: 1) not possible, see: https://github.com/corrosion-rs/corrosion/issues/115
arch: ['osx_amd64', 'osx_arm64']
env:
GEN: ninja
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'
- name: Install Ninja
run: brew install ninja
- name: Install Rust Cross-compilation targets
if: ${{ matrix.arch == 'osx_arm64' }}
run: rustup target add aarch64-apple-darwin
- uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Checkout DuckDB to version
if: ${{ matrix.duckdb_version != '<submodule_version>'}}
run: |
cd duckdb
git checkout ${{ matrix.duckdb_version }}
# Build extension
- name: Build extension
env:
Rust_CARGO_TARGET: ${{ matrix.arch == 'osx_arm64' && 'aarch64-apple-darwin' || '' }}
CMAKE_OSX_ARCHITECTURES: ${{ matrix.arch == 'osx_arm64' && 'arm64' || '' }}
# Static build on OS X breaks psql plugin, see https://github.com/duckdb/duckdb/issues/6521
EXTENSION_STATIC_BUILD: 0
shell: bash
run: make release
- name: Build extension
if: ${{ matrix.arch != 'osx_arm64'}}
run: make test
- uses: actions/upload-artifact@v2
with:
name: ${{matrix.arch}}-extensions
path: |
build/release/extension/psql/psql.duckdb_extension
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
- name: Deploy
env:
SSH_USER: ${{ secrets.SSH_USER }}
SSH_HOST: ${{ secrets.SSH_HOST }}
UPLOAD_BASE_PATH: ${{ secrets.UPLOAD_BASE_PATH }}
run: |
cd duckdb
git fetch --tags
export DUCKDB_VERSION=`git tag --points-at HEAD`
export DUCKDB_VERSION=${DUCKDB_VERSION:=`git log -1 --format=%h`}
cd ..
if [[ "$SSH_HOST" == "" ]] ; then
echo 'No key set, skipping'
elif [[ "$GITHUB_REF" =~ ^(refs/tags/v.+)$ ]] ; then
./scripts/extension-upload.sh psql ${{ github.ref_name }} $DUCKDB_VERSION ${{matrix.arch}} true
elif [[ "$GITHUB_REF" =~ ^(refs/heads/main)$ ]] ; then
./scripts/extension-upload.sh psql `git log -1 --format=%h` $DUCKDB_VERSION ${{matrix.arch}} false
fi