Skip to content

Add additional versions #49

Add additional versions

Add additional versions #49

Workflow file for this run

name: macOS
on: [push, pull_request]
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 (Universal)
runs-on: macos-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
strategy:
matrix:
# Add commits/tags to build against other DuckDB versions
duckdb_version: [ '<submodule_version>' ]
arch: ['amd64', 'arm64']
env:
OSX_BUILD_UNIVERSAL: 1
GEN: ninja
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'
- name: Install Ninja
run: brew install ninja
- 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 }}
cd ../duckdb-ext/duckdb
git checkout ${{ matrix.duckdb_version }}
# Build extension
- name: Build extension
env:
OSX_BUILD_AARCH64: ${{ matrix.arch == 'arm64' && 1 || 0 }}
shell: bash
run: |
if [[ "$OSX_BUILD_AARCH64" == "1" ]]; then rustup target add aarch64-apple-darwin; fi
make release
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.OIDC_ROLE_ARN }}
aws-region: ${{ secrets.S3_REGION }}
- name: Deploy
env:
BUCKET_NAME: ${{ secrets.S3_BUCKET }}
run: |
cd duckdb
git fetch --tags
export DUCKDB_VERSION=`git tag --points-at HEAD`
echo $DUCKDB_VERSION
export DUCKDB_VERSION=${DUCKDB_VERSION:=`git log -1 --format=%h`}
echo $DUCKDB_VERSION
cd ..
if [[ "$BUCKET_NAME" == "" ]] ; then
echo 'No bucket set, skipping'
elif [[ "$GITHUB_REF" =~ ^(refs/tags/v.+)$ ]] ; then
python -m pip install awscli
./scripts/extension-upload.sh athena ${{ github.ref_name }} $DUCKDB_VERSION osx_${{matrix.arch}} $BUCKET_NAME true
elif [[ "$GITHUB_REF" =~ ^(refs/heads/main)$ ]] ; then
python -m pip install awscli
./scripts/extension-upload.sh athena `git log -1 --format=%h` $DUCKDB_VERSION osx_${{matrix.arch}} $BUCKET_NAME false
fi