MVP #7
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 | |
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 (${{ matrix.osx_build_arch }}) | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
# Add commits/tags to build against other DuckDB versions | |
duckdb_version: [ '<submodule_version>' ] | |
osx_build_arch: [ 'x86_64', 'arm64' ] | |
include: | |
- osx_build_arch: 'x86_64' | |
duckdb_arch: 'osx_amd64' | |
- osx_build_arch: 'arm64' | |
duckdb_arch: 'osx_arm64' | |
env: | |
OSX_BUILD_ARCH: ${{ matrix.osx_build_arch }} | |
GEN: Ninja | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: 'true' | |
- name: Install Ninja | |
run: brew install ninja | |
- name: Setup Ccache | |
uses: hendrikmuhs/ccache-action@main | |
with: | |
key: ${{ github.job }}-${{ matrix.duckdb_version }} | |
- 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 }} | |
- name: Build extension | |
shell: bash | |
run: | | |
make release | |
- name: Test Extension | |
if: ${{ matrix.osx_build_arch == 'x86_64'}} | |
shell: bash | |
run: | | |
make test | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: osx-${{ matrix.osx_build_arch }}-extension | |
path: | | |
build/release/extension/vector/vector.duckdb_extension | |
- name: Deploy | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DEPLOY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DEPLOY_KEY }} | |
AWS_DEFAULT_REGION: ${{ secrets.S3_REGION }} | |
BUCKET_NAME: ${{ secrets.S3_BUCKET }} | |
DUCKDB_EXTENSION_SIGNING_PK: ${{ secrets.DUCKDB_EXTENSION_SIGNING_KEY }} | |
run: | | |
git config --global --add safe.directory '*' | |
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 [[ "$AWS_ACCESS_KEY_ID" == "" ]] ; then | |
echo 'No key set, skipping' | |
elif [[ "$GITHUB_REF" =~ ^(refs/tags/v.+)$ ]] ; then | |
python3 -m pip install pip awscli | |
./scripts/extension-upload.sh vector ${{ github.ref_name }} $DUCKDB_VERSION ${{matrix.duckdb_arch}} $BUCKET_NAME true | |
elif [[ "$GITHUB_REF" =~ ^(refs/heads/main)$ ]] ; then | |
python3 -m pip install pip awscli | |
./scripts/extension-upload.sh vector `git log -1 --format=%h` $DUCKDB_VERSION ${{matrix.duckdb_arch}} $BUCKET_NAME false | |
fi |