-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.79 KB
/
Copy pathbuild.yml
File metadata and controls
53 lines (47 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Continuous integration
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
10.0.x
# Download pre-built native library for CI
- name: Download pg-ffi native library
run: |
TAG=$(gh release list --repo encryption4all/postguard --json tagName -q '[.[] | select(.tagName | startswith("pg-ffi-"))][0].tagName' 2>/dev/null || true)
if [ -n "$TAG" ]; then
mkdir -p src/runtimes/linux-x64/native
gh release download "$TAG" --repo encryption4all/postguard --pattern "pg-ffi-linux-x64.tar.gz" --dir /tmp
tar xzf /tmp/pg-ffi-linux-x64.tar.gz -C src/runtimes/linux-x64/native
else
echo "::warning::No pg-ffi release found. Building from source."
rustup default stable
git clone --depth 1 https://github.com/encryption4all/postguard.git /tmp/postguard
cargo build --release -p pg-ffi --manifest-path /tmp/postguard/Cargo.toml
mkdir -p src/runtimes/linux-x64/native
cp /tmp/postguard/target/release/libpg_ffi.so src/runtimes/linux-x64/native/
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: dotnet build E4A.PostGuard.slnx --configuration Release
- name: Pack (dry run)
run: dotnet pack src/E4A.PostGuard.csproj --configuration Release --no-build --output ./artifacts
- name: Upload package artifact
uses: actions/upload-artifact@v7
with:
name: nuget-package
path: ./artifacts/*.nupkg
retention-days: 7