reformat code #75
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
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '*' | |
branches: | |
- main | |
- master | |
jobs: | |
build: | |
name: build ${{ matrix.platform }} ${{ matrix.target }} | |
strategy: | |
matrix: | |
include: | |
- platform: windows-latest | |
target: x86_64-pc-windows-msvc | |
duckdb_platform: windows_amd64 | |
library_output: duckdb_protobuf.dll | |
- platform: macos-latest | |
target: aarch64-apple-darwin | |
library_output: libduckdb_protobuf.dylib | |
duckdb_platform: osx_arm64 | |
- platform: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
library_output: libduckdb_protobuf.so | |
duckdb_platform: linux_amd64_gcc4 | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: make vendor | |
- run: cargo build --target ${{ matrix.target }} --release | |
- name: attach metadata | |
run: > | |
cargo run | |
--package duckdb_metadata_bin | |
--bin duckdb_metadata | |
-- | |
--input target/${{ matrix.target }}/release/${{ matrix.library_output }} | |
--output target/${{ matrix.target }}/release/protobuf.duckdb_extension | |
--extension-version v0.0.1 | |
--duckdb-api-version v0.0.1 | |
--extension-abi-type C_STRUCT | |
--platform ${{ matrix.duckdb_platform }} | |
- name: save artifacts | |
if: success() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-${{ matrix.platform }}-${{ matrix.target }} | |
path: target/${{ matrix.target }}/release/protobuf.duckdb_extension | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/download-artifact@v4 | |
- run: | | |
mkdir release | |
mv build-macos-latest-aarch64-apple-darwin/protobuf.duckdb_extension ./release/protobuf.osx_arm64.duckdb_extension | |
mv build-ubuntu-latest-x86_64-unknown-linux-gnu/protobuf.duckdb_extension ./release/protobuf.linux_amd64_gcc4.duckdb_extension | |
mv build-windows-latest-x86_64-pc-windows-msvc/protobuf.duckdb_extension ./release/protobuf.windows_amd64.duckdb_extension | |
- name: upload files to r2 | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: auto | |
run: | | |
aws s3 cp \ | |
--endpoint-url https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com \ | |
./release/protobuf.osx_arm64.duckdb_extension \ | |
s3://duckdb-extensions/v1.1.0/osx_arm64/protobuf.duckdb_extension | |
aws s3 cp \ | |
--endpoint-url https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com \ | |
./release/protobuf.linux_amd64_gcc4.duckdb_extension \ | |
s3://duckdb-extensions/v1.1.0/linux_amd64_gcc4/protobuf.duckdb_extension | |
aws s3 cp \ | |
--endpoint-url https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com \ | |
./release/protobuf.windows_amd64.duckdb_extension \ | |
s3://duckdb-extensions/v1.1.0/windows_amd64/protobuf.duckdb_extension | |
- name: release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: release/* |