Skip to content

Commit f6c553b

Browse files
committed
_
1 parent 8f9037f commit f6c553b

File tree

1 file changed

+38
-5
lines changed

1 file changed

+38
-5
lines changed

.github/workflows/build.yaml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,52 @@
1+
name: Build LibSqlite_Turso Shared Library
2+
13
on:
24
push:
35
branches:
46
- main
7+
tags:
8+
- '*'
59
pull_request:
6-
branches:
7-
- main
810

911
jobs:
10-
build_and_test:
12+
build:
1113
name: Build LibSqlite_Turso
12-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-22.04
1315
steps:
1416
- uses: actions/checkout@v2
1517
- uses: actions-rs/toolchain@v1
1618
with:
1719
toolchain: stable
18-
- run: cargo build --release --all-features
20+
- run: |
21+
cargo build
22+
cargo build --release --all-features
23+
24+
25+
26+
- name: Find built shared library
27+
id: find_artifact
28+
shell: bash
29+
run: |
30+
echo "Looking for debug and release .so files..."
1931
32+
DEBUG_SO=$(find target/debug -type f -name "*.so" | head -n1)
33+
RELEASE_SO=$(find target/release -type f -name "*.so" | head -n1)
34+
35+
if [[ -z "$DEBUG_SO" || -z "$RELEASE_SO" ]]; then
36+
echo "Error: Could not find both debug and release .so files."
37+
exit 1
38+
fi
39+
40+
DEBUG_NAME="$(basename "${DEBUG_SO%.*}")-debug.so"
41+
RELEASE_NAME="$(basename "${RELEASE_SO%.*}")-release.so"
42+
43+
cp "$DEBUG_SO" "$DEBUG_NAME"
44+
cp "$RELEASE_SO" "$RELEASE_NAME"
45+
46+
echo "DEBUG_ARTIFACT=$DEBUG_NAME" >> $GITHUB_ENV
47+
echo "RELEASE_ARTIFACT=$RELEASE_NAME" >> $GITHUB_ENV
48+
49+
- name: Upload built library as artifact
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: ${{ env.artifact_path }}

0 commit comments

Comments
 (0)