Try fix build #41
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: Build flAPI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
arch: x86_64 | |
runner: ubuntu-latest | |
- os: macos-latest | |
arch: universal | |
runner: macos-latest | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Checkout submodule | |
uses: actions/checkout@v3 | |
with: | |
repository: duckdb/duckdb | |
path: duckdb | |
ref: v1.1.2 | |
- name: Install dependencies (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential cmake ninja-build | |
- name: Install dependencies (macOS) | |
if: runner.os == 'macOS' | |
run: | | |
brew install ninja | |
- name: Cache vcpkg | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/vcpkg | |
./vcpkg/installed | |
key: ${{ runner.os }}-${{ matrix.arch }}-vcpkg-${{ hashFiles('vcpkg.json') }} | |
- name: Configure vcpkg | |
run: | | |
./vcpkg/bootstrap-vcpkg.sh | |
./vcpkg/vcpkg integrate install | |
- name: Build Release | |
run: make release | |
- name: Verify binary exists | |
run: | | |
if [ "${{ runner.os }}" = "macOS" ]; then | |
ls -l ${{github.workspace}}/build/universal/flapi | |
file ${{github.workspace}}/build/universal/flapi | |
else | |
ls -l ${{github.workspace}}/build/release/flapi | |
file ${{github.workspace}}/build/release/flapi | |
fi | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: flapi-${{ matrix.os }}-${{ matrix.arch }}-${{ github.sha }} | |
path: | | |
${{ runner.os == 'macOS' && 'build/universal/flapi' || 'build/release/flapi' }} | |
if-no-files-found: error | |
retention-days: 90 | |
# Docker build only for x86_64 Linux | |
docker: | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download x86_64 Linux artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: flapi-ubuntu-latest-x86_64-${{ github.sha }} | |
path: build/release | |
- name: Set file permissions | |
run: chmod +x build/release/flapi | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Lowercase github.repository_owner | |
run: | | |
echo "REPOSITORY_OWNER=`echo ${{github.repository_owner}} | tr '[:upper:]' '[:lower:]'`" >>${GITHUB_ENV} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: Dockerfile | |
push: ${{ github.event_name == 'push' }} | |
tags: | | |
${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && format('ghcr.io/{0}/flapi:latest', env.REPOSITORY_OWNER) || '' }} | |
ghcr.io/${{ env.REPOSITORY_OWNER }}/flapi:${{ github.sha }} | |
build-args: | | |
GITHUB_SHA=${{ github.sha }} |