From da8477ad33224a605a8b602bdd21cd289f2c1cc4 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Fri, 12 Jan 2024 15:00:06 -0800 Subject: [PATCH 01/12] ci: Build `prqlc-clib` as artifacts --- .github/actions/build-prqlc-clib/action.yaml | 93 ++++++++++++++++++++ .github/workflows/tests.yaml | 34 +++++++ 2 files changed, 127 insertions(+) create mode 100644 .github/actions/build-prqlc-clib/action.yaml diff --git a/.github/actions/build-prqlc-clib/action.yaml b/.github/actions/build-prqlc-clib/action.yaml new file mode 100644 index 000000000000..e4a5ec858e9f --- /dev/null +++ b/.github/actions/build-prqlc-clib/action.yaml @@ -0,0 +1,93 @@ +name: build-prqlc +description: > + Build prqlc +inputs: + target: + description: Build target + required: true + profile: + description: Build profile option; `dev` or `release`. + required: true + features: + description: Features to enable + default: "" +outputs: + artifact-name: + description: The name of the artifact + value: ${{ steps.echo-artifact-name.outputs.artifact-name }} + +runs: + using: composite + steps: + - run: rustup target add ${{ inputs.target }} + shell: bash + + - run: ./.github/workflows/scripts/set_version.sh + shell: bash + + - uses: Swatinem/rust-cache@v2 + with: + # Share cache with `test-rust`, except for `musl` targets. + save-if: + ${{ (github.ref == 'refs/heads/main') && contains(inputs.target, + 'musl') }} + shared-key: rust-${{ inputs.target }} + prefix-key: ${{ env.version }} + + - if: runner.os == 'Linux' + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y musl-tools + + - if: runner.os == 'Windows' && inputs.profile == 'release' + shell: bash + run: | + echo 'RUSTFLAGS=-Ctarget-feature=+crt-static' >>"$GITHUB_ENV" + + - if: inputs.target == 'aarch64-unknown-linux-musl' + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y gcc-aarch64-linux-gnu + echo 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc' >>"$GITHUB_ENV" + echo 'CC=aarch64-linux-gnu-gcc' >>"$GITHUB_ENV" + + - name: cargo build + uses: richb-hanover/cargo@v1.1.0 + with: + command: build + args: + --profile=${{ inputs.profile }} --locked --target=${{ inputs.target }} + --features=${{ inputs.features }} ${{ contains(inputs.target, 'musl') + && '--package=prqlc-clib' || '--all-targets' }} + + - name: Create artifact for Linux and macOS + shell: bash + if: runner.os != 'Windows' + run: | + export ARTIFACT_NAME="prqlc-clib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.tar.gz" + echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" + cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} + cp ../../../prqlc/prqlc-clib/README.md . + tar czf "../../../${ARTIFACT_NAME}" prqlc-clib ../../../LICENSE README.md + + - name: Create artifact for Windows + shell: bash + if: runner.os == 'Windows' + run: | + export ARTIFACT_NAME="prqlc-clib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.zip" + echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" + cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} + cp ../../../prqlc/prqlc-clib/README.md . + 7z a "../../../${ARTIFACT_NAME}" prqlc-clib.exe ../../../LICENSE README.md + + - name: Upload prqlc-clib + uses: actions/upload-artifact@v3 + with: + name: prqlc-${{ inputs.target }} + path: ${{ env.ARTIFACT_NAME }} + + - id: echo-artifact-name + shell: bash + run: echo "artifact-name=${{ env.ARTIFACT_NAME }}" >>"$GITHUB_OUTPUT" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index fcb5fb1d66d9..e989cd7f2e63 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -638,6 +638,40 @@ jobs: RUSTFLAGS: "-C debuginfo=0" RUSTDOCFLAGS: "-Dwarnings" + build-prqlc-clib: + runs-on: ${{ matrix.os }} + needs: rules + if: needs.rules.outputs.rust == 'true' || needs.rules.outputs.main == 'true' + strategy: + fail-fast: false + matrix: + include: + # Match the features with the available caches from tests + - os: ubuntu-latest + target: x86_64-unknown-linux-musl + features: default + - os: macos-latest + target: x86_64-apple-darwin + features: default,test-dbs + - os: windows-latest + target: x86_64-pc-windows-msvc + features: default + steps: + - name: 📂 Checkout code + uses: actions/checkout@v4 + - uses: ./.github/actions/build-prqlc-clib + with: + target: ${{ matrix.target }} + profile: dev + features: ${{ matrix.features }} + # These are the same env variables as in `test-rust.yaml`. Custom actions + # don't allow setting env variables for the whole job, so we do it here. + env: + CARGO_TERM_COLOR: always + CLICOLOR_FORCE: 1 + RUSTFLAGS: "-C debuginfo=0" + RUSTDOCFLAGS: "-Dwarnings" + create-issue-on-nightly-failure: runs-on: ubuntu-latest needs: From b4aefe931943ce68544b2da004a4a4d79a3fa664 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Fri, 12 Jan 2024 15:08:20 -0800 Subject: [PATCH 02/12] --- .github/actions/build-prqlc-clib/action.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/build-prqlc-clib/action.yaml b/.github/actions/build-prqlc-clib/action.yaml index e4a5ec858e9f..096c86fde7ef 100644 --- a/.github/actions/build-prqlc-clib/action.yaml +++ b/.github/actions/build-prqlc-clib/action.yaml @@ -69,8 +69,8 @@ runs: export ARTIFACT_NAME="prqlc-clib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.tar.gz" echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} - cp ../../../prqlc/prqlc-clib/README.md . - tar czf "../../../${ARTIFACT_NAME}" prqlc-clib ../../../LICENSE README.md + # cp ../../../prqlc/prqlc-clib/README.md . + tar czf "../../../${ARTIFACT_NAME}" prqlc-clib ../../../LICENSE # README.md - name: Create artifact for Windows shell: bash @@ -79,8 +79,8 @@ runs: export ARTIFACT_NAME="prqlc-clib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.zip" echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} - cp ../../../prqlc/prqlc-clib/README.md . - 7z a "../../../${ARTIFACT_NAME}" prqlc-clib.exe ../../../LICENSE README.md + # cp ../../../prqlc/prqlc-clib/README.md . + 7z a "../../../${ARTIFACT_NAME}" prqlc-clib.exe ../../../LICENSE # README.md - name: Upload prqlc-clib uses: actions/upload-artifact@v3 From a762d486aa513439e670e3dc31127092e5752d49 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Fri, 12 Jan 2024 15:10:56 -0800 Subject: [PATCH 03/12] --- prqlc/bindings/clib/Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/prqlc/bindings/clib/Cargo.toml b/prqlc/bindings/clib/Cargo.toml index b3c8accb56c7..b12d0b7ec64f 100644 --- a/prqlc/bindings/clib/Cargo.toml +++ b/prqlc/bindings/clib/Cargo.toml @@ -8,6 +8,10 @@ repository.workspace = true rust-version.workspace = true version.workspace = true +# This means we can build with `--features=default`, which can make builds more generic +[features] +default = [] + [lib] crate_type = ["staticlib", "cdylib"] doctest = false From 95d49e3caea2f8f3701e4b46b203877cd43163d8 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Fri, 12 Jan 2024 15:17:54 -0800 Subject: [PATCH 04/12] --- .github/actions/build-prqlc-clib/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-prqlc-clib/action.yaml b/.github/actions/build-prqlc-clib/action.yaml index 096c86fde7ef..4eb3976b57e2 100644 --- a/.github/actions/build-prqlc-clib/action.yaml +++ b/.github/actions/build-prqlc-clib/action.yaml @@ -70,7 +70,7 @@ runs: echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} # cp ../../../prqlc/prqlc-clib/README.md . - tar czf "../../../${ARTIFACT_NAME}" prqlc-clib ../../../LICENSE # README.md + tar czf "../../../${ARTIFACT_NAME}" prqlc-clib* ../../../LICENSE # README.md - name: Create artifact for Windows shell: bash @@ -80,7 +80,7 @@ runs: echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} # cp ../../../prqlc/prqlc-clib/README.md . - 7z a "../../../${ARTIFACT_NAME}" prqlc-clib.exe ../../../LICENSE # README.md + 7z a "../../../${ARTIFACT_NAME}" prqlc-clib* ../../../LICENSE # README.md - name: Upload prqlc-clib uses: actions/upload-artifact@v3 From aabdc9dd3d15403e4595180a0a45f05cabe09a44 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Fri, 12 Jan 2024 15:45:09 -0800 Subject: [PATCH 05/12] --- .github/actions/build-prqlc-clib/action.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/build-prqlc-clib/action.yaml b/.github/actions/build-prqlc-clib/action.yaml index 4eb3976b57e2..f43cb42b46e0 100644 --- a/.github/actions/build-prqlc-clib/action.yaml +++ b/.github/actions/build-prqlc-clib/action.yaml @@ -66,21 +66,21 @@ runs: shell: bash if: runner.os != 'Windows' run: | - export ARTIFACT_NAME="prqlc-clib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.tar.gz" + export ARTIFACT_NAME="prqlc_lib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.tar.gz" echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} # cp ../../../prqlc/prqlc-clib/README.md . - tar czf "../../../${ARTIFACT_NAME}" prqlc-clib* ../../../LICENSE # README.md + tar czf "../../../${ARTIFACT_NAME}" prqlc_lib* ../../../LICENSE # README.md - name: Create artifact for Windows shell: bash if: runner.os == 'Windows' run: | - export ARTIFACT_NAME="prqlc-clib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.zip" + export ARTIFACT_NAME="prqlc_lib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.zip" echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} # cp ../../../prqlc/prqlc-clib/README.md . - 7z a "../../../${ARTIFACT_NAME}" prqlc-clib* ../../../LICENSE # README.md + 7z a "../../../${ARTIFACT_NAME}" prqlc_lib* ../../../LICENSE # README.md - name: Upload prqlc-clib uses: actions/upload-artifact@v3 From b9df845635addca66f78306503d9b02f18b48a37 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Fri, 12 Jan 2024 15:49:20 -0800 Subject: [PATCH 06/12] --- .github/actions/build-prqlc-clib/action.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/build-prqlc-clib/action.yaml b/.github/actions/build-prqlc-clib/action.yaml index f43cb42b46e0..d1f51b4d5def 100644 --- a/.github/actions/build-prqlc-clib/action.yaml +++ b/.github/actions/build-prqlc-clib/action.yaml @@ -66,21 +66,21 @@ runs: shell: bash if: runner.os != 'Windows' run: | - export ARTIFACT_NAME="prqlc_lib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.tar.gz" + export ARTIFACT_NAME="libprqlc_lib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.tar.gz" echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} # cp ../../../prqlc/prqlc-clib/README.md . - tar czf "../../../${ARTIFACT_NAME}" prqlc_lib* ../../../LICENSE # README.md + tar czf "../../../${ARTIFACT_NAME}" libprqlc_lib* ../../../LICENSE # README.md - name: Create artifact for Windows shell: bash if: runner.os == 'Windows' run: | - export ARTIFACT_NAME="prqlc_lib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.zip" + export ARTIFACT_NAME="libprqlc_lib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.zip" echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} # cp ../../../prqlc/prqlc-clib/README.md . - 7z a "../../../${ARTIFACT_NAME}" prqlc_lib* ../../../LICENSE # README.md + 7z a "../../../${ARTIFACT_NAME}" libprqlc_lib* ../../../LICENSE # README.md - name: Upload prqlc-clib uses: actions/upload-artifact@v3 From cd5ea1433d4afbe59bf5f42163eb663d9dc3ceb3 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Fri, 12 Jan 2024 16:00:23 -0800 Subject: [PATCH 07/12] --- .github/actions/build-prqlc-clib/action.yaml | 2 +- prqlc/bindings/clib/Cargo.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-prqlc-clib/action.yaml b/.github/actions/build-prqlc-clib/action.yaml index d1f51b4d5def..fa990e6b5dbd 100644 --- a/.github/actions/build-prqlc-clib/action.yaml +++ b/.github/actions/build-prqlc-clib/action.yaml @@ -85,7 +85,7 @@ runs: - name: Upload prqlc-clib uses: actions/upload-artifact@v3 with: - name: prqlc-${{ inputs.target }} + name: libprqlc_lib-${{ inputs.target }} path: ${{ env.ARTIFACT_NAME }} - id: echo-artifact-name diff --git a/prqlc/bindings/clib/Cargo.toml b/prqlc/bindings/clib/Cargo.toml index b12d0b7ec64f..8321a42009fd 100644 --- a/prqlc/bindings/clib/Cargo.toml +++ b/prqlc/bindings/clib/Cargo.toml @@ -14,6 +14,7 @@ default = [] [lib] crate_type = ["staticlib", "cdylib"] +# crate_type = ["cdylib"] doctest = false name = "prqlc_lib" test = false From 8ee1096e2f6e424bf0e1ecf3e5c9c98f6d6d0b44 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Fri, 12 Jan 2024 16:30:23 -0800 Subject: [PATCH 08/12] --- .github/actions/build-prqlc-clib/action.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/build-prqlc-clib/action.yaml b/.github/actions/build-prqlc-clib/action.yaml index fa990e6b5dbd..faca826f898f 100644 --- a/.github/actions/build-prqlc-clib/action.yaml +++ b/.github/actions/build-prqlc-clib/action.yaml @@ -69,8 +69,8 @@ runs: export ARTIFACT_NAME="libprqlc_lib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.tar.gz" echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} - # cp ../../../prqlc/prqlc-clib/README.md . - tar czf "../../../${ARTIFACT_NAME}" libprqlc_lib* ../../../LICENSE # README.md + ls -al + tar czf "../../../${ARTIFACT_NAME}" libprqlc_lib* - name: Create artifact for Windows shell: bash @@ -79,8 +79,8 @@ runs: export ARTIFACT_NAME="libprqlc_lib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.zip" echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} - # cp ../../../prqlc/prqlc-clib/README.md . - 7z a "../../../${ARTIFACT_NAME}" libprqlc_lib* ../../../LICENSE # README.md + ls -al + 7z a "../../../${ARTIFACT_NAME}" libprqlc_lib* - name: Upload prqlc-clib uses: actions/upload-artifact@v3 From 6e12a23147c874a680561645b509660696dac7fb Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Fri, 12 Jan 2024 16:51:34 -0800 Subject: [PATCH 09/12] --- .github/actions/build-prqlc-clib/action.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/actions/build-prqlc-clib/action.yaml b/.github/actions/build-prqlc-clib/action.yaml index faca826f898f..b9ddb68299ca 100644 --- a/.github/actions/build-prqlc-clib/action.yaml +++ b/.github/actions/build-prqlc-clib/action.yaml @@ -1,6 +1,10 @@ -name: build-prqlc +name: build-prqlc-clib description: > - Build prqlc + A version of `build-prqlc` for the C bindings. + + Note that this is quite open to change, including names and which files we + package. Contributions and/or suggestions are welcome. + inputs: target: description: Build target @@ -70,7 +74,7 @@ runs: echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} ls -al - tar czf "../../../${ARTIFACT_NAME}" libprqlc_lib* + tar czf "../../../${ARTIFACT_NAME}" *prqlc_lib* - name: Create artifact for Windows shell: bash @@ -80,7 +84,7 @@ runs: echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} ls -al - 7z a "../../../${ARTIFACT_NAME}" libprqlc_lib* + 7z a "../../../${ARTIFACT_NAME}" *prqlc_lib* - name: Upload prqlc-clib uses: actions/upload-artifact@v3 From 24e6aa2de67c379510cb071c1a0362f55eebad8c Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Fri, 12 Jan 2024 16:53:16 -0800 Subject: [PATCH 10/12] --- .github/actions/build-prqlc-clib/action.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/build-prqlc-clib/action.yaml b/.github/actions/build-prqlc-clib/action.yaml index b9ddb68299ca..476362b7931b 100644 --- a/.github/actions/build-prqlc-clib/action.yaml +++ b/.github/actions/build-prqlc-clib/action.yaml @@ -70,7 +70,7 @@ runs: shell: bash if: runner.os != 'Windows' run: | - export ARTIFACT_NAME="libprqlc_lib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.tar.gz" + export ARTIFACT_NAME="prqlc_lib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.tar.gz" echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} ls -al @@ -80,7 +80,7 @@ runs: shell: bash if: runner.os == 'Windows' run: | - export ARTIFACT_NAME="libprqlc_lib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.zip" + export ARTIFACT_NAME="prqlc_lib-v${{ github.ref_type == 'tag' && github.ref_name || 0 }}-${{ matrix.target }}.zip" echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >>"$GITHUB_ENV" cd target/${{ matrix.target }}/${{ inputs.profile == 'release' && 'release' || 'debug' }} ls -al @@ -89,7 +89,7 @@ runs: - name: Upload prqlc-clib uses: actions/upload-artifact@v3 with: - name: libprqlc_lib-${{ inputs.target }} + name: prqlc_lib-${{ inputs.target }} path: ${{ env.ARTIFACT_NAME }} - id: echo-artifact-name From 25bb3be6c18ae7c5547494756ee4b54abdf5b765 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Fri, 12 Jan 2024 16:55:23 -0800 Subject: [PATCH 11/12] --- .github/actions/build-prqlc/action.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/build-prqlc/action.yaml b/.github/actions/build-prqlc/action.yaml index 0b6e0b9286f2..be48e95c1a52 100644 --- a/.github/actions/build-prqlc/action.yaml +++ b/.github/actions/build-prqlc/action.yaml @@ -1,6 +1,9 @@ name: build-prqlc description: > Build prqlc + + Note that much of this is copy/pasted into build-prqlc-clib, so changes here + should generally be copied into that file. inputs: target: description: Build target From 43c9d076b8af0b5a40282789b9f04a1348cc1eb2 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Fri, 12 Jan 2024 17:21:21 -0800 Subject: [PATCH 12/12] --- .github/workflows/release.yaml | 34 ++++++++++++++++++++++++++++++++++ prqlc/bindings/clib/Cargo.toml | 4 +++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index be54b86f2813..5f63bc24f044 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -66,6 +66,40 @@ jobs: append_body: true files: ${{ steps.build-artifact.outputs.artifact-name }} + build-prqlc_lib: + # Currently a copy/paste of `build-prqlc`. + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-musl + - os: ubuntu-latest + target: aarch64-unknown-linux-musl + - os: macos-latest + target: x86_64-apple-darwin + - os: macos-latest + target: aarch64-apple-darwin + - os: windows-latest + target: x86_64-pc-windows-msvc + permissions: + contents: write + steps: + - name: 📂 Checkout code + uses: actions/checkout@v4 + - uses: ./.github/actions/build-prqlc-clib + id: build-artifact + with: + target: ${{ matrix.target }} + profile: release + - name: Upload release artifact + if: github.event_name == 'release' + uses: softprops/action-gh-release@v1 + with: + append_body: true + files: ${{ steps.build-artifact.outputs.artifact-name }} + winget-release: runs-on: ubuntu-latest needs: build-prqlc diff --git a/prqlc/bindings/clib/Cargo.toml b/prqlc/bindings/clib/Cargo.toml index 8321a42009fd..1533bd3b535e 100644 --- a/prqlc/bindings/clib/Cargo.toml +++ b/prqlc/bindings/clib/Cargo.toml @@ -13,8 +13,10 @@ version.workspace = true default = [] [lib] +# We produce both of these at the moment, but could consider refining this. ref +# https://github.com/rust-lang/cargo/issues/8607 & +# https://github.com/rust-lang/rust/issues/59302 crate_type = ["staticlib", "cdylib"] -# crate_type = ["cdylib"] doctest = false name = "prqlc_lib" test = false