-
Notifications
You must be signed in to change notification settings - Fork 3
144 lines (142 loc) · 5.64 KB
/
sodium.yml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Update Sodium
on:
release:
types:
- published
workflow_dispatch:
push:
branches:
- master
paths:
- '.github/workflows/sodium.yml'
permissions:
contents: write
jobs:
build:
name: Build Sodium for ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Android Arm64",
os: ubuntu-latest,
command: "./dist-build/android-armv8-a.sh",
output-file: "libsodium-android-armv8-a+crypto/lib/libsodium.so",
file: "libsodium.so",
rid: "android-arm64",
}
- {
name: "Linux x64 (glibc)",
os: ubuntu-latest,
command: "zig build -Dshared=true -Doptimize=ReleaseFast -Dtarget=x86_64-linux-gnu",
output-file: "zig-out/lib/libsodium.so",
file: "libsodium.so",
rid: "linux-x64",
}
- {
name: "Linux x64 (musl)",
os: ubuntu-latest,
command: "zig build -Dshared=true -Doptimize=ReleaseFast -Dtarget=x86_64-linux-musl",
output-file: "zig-out/lib/libsodium.so",
file: "libsodium.so",
rid: "linux-x64-musl",
}
- {
name: "Linux Arm64 (glibc)",
os: ubuntu-latest,
command: "zig build -Dshared=true -Doptimize=ReleaseFast -Dtarget=aarch64-linux-gnu",
output-file: "zig-out/lib/libsodium.so",
file: "libsodium.so",
rid: "linux-arm64",
}
- {
name: "Linux Arm64 (musl)",
os: ubuntu-latest,
command: "zig build -Dshared=true -Doptimize=ReleaseFast -Dtarget=aarch64-linux-musl",
output-file: "zig-out/lib/libsodium.so",
file: "libsodium.so",
rid: "linux-arm64-musl",
}
- {
name: "MacOS x64",
os: macos-latest,
command: "zig build -Dshared=true -Doptimize=ReleaseFast -Dtarget=x86_64-macos",
output-file: "zig-out/lib/libsodium.dylib",
file: "libsodium.dylib",
rid: "osx-x64",
}
- {
name: "iOS",
os: macos-latest,
command: "zig build -Dshared=true -Doptimize=ReleaseFast -Dtarget=aarch64-ios",
output-file: "zig-out/lib/libsodium.dylib",
file: "libsodium.dylib",
rid: "ios-arm64",
}
- {
name: "Windows x86",
os: windows-latest,
command: "cd builds/msvc/vs2022 && C:/Program\\ Files/Microsoft\\ Visual\\ Studio/2022/Enterprise/MSBuild/Current/Bin/msbuild.exe libsodium/libsodium.vcxproj /p:Configuration=DynRelease /p:Platform=Win32 /m && cd ../../../",
output-file: "bin/Win32/Release/v143/dynamic/libsodium.dll",
file: "sodium.dll",
rid: "win-x86",
arch: "x86"
}
- {
name: "Windows x64",
os: windows-latest,
command: "cd builds/msvc/vs2022 && C:/Program\\ Files/Microsoft\\ Visual\\ Studio/2022/Enterprise/MSBuild/Current/Bin/msbuild.exe libsodium/libsodium.vcxproj /p:Configuration=DynRelease /p:Platform=x64 /m && cd ../../../",
output-file: "bin/x64/Release/v143/dynamic/libsodium.dll",
file: "sodium.dll",
rid: "win-x64",
arch: "x64"
}
- {
name: "Windows Arm64",
os: windows-latest,
command: "cd builds/msvc/vs2022 && C:/Program\\ Files/Microsoft\\ Visual\\ Studio/2022/Enterprise/MSBuild/Current/Bin/msbuild.exe libsodium/libsodium.vcxproj /p:Configuration=DynRelease /p:Platform=arm64 /m && cd ../../../",
output-file: "bin/arm64/Release/v143/dynamic/libsodium.dll",
file: "sodium.dll",
rid: "win-arm64",
arch: "arm64"
}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
if: contains(matrix.config.command, 'zig')
with:
version: 0.11.0
cache: false
- name: Set up MSBuild
if: contains(matrix.config.rid, 'win')
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: ${{ matrix.config.arch }}
- name: Setup Android SDK
if: contains(matrix.config.rid, 'android')
uses: android-actions/setup-android@v3
- name: Build on ${{ matrix.config.name }}
shell: bash
run: |
git clone https://github.com/jedisct1/libsodium.git libs/sodium
cd libs/sodium
echo "SODIUM_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV
git checkout $SODIUM_VERSION
${{ matrix.config.command }}
mkdir -p "${{ github.workspace }}/libs/libsodium/${{ matrix.config.rid }}/native"
rm -f "${{ github.workspace }}/libs/libsodium/${{ matrix.config.rid }}/native/${{ matrix.config.file }}"
mv ${{ matrix.config.output-file }} "${{ github.workspace }}/libs/libsodium/${{ matrix.config.rid }}/native/${{ matrix.config.file }}"
- name: "Update ${{ matrix.config.file }}"
uses: EndBug/add-and-commit@v9
with:
add: "libs/libsodium/"
default_author: github_actions
message: Update ${{ matrix.config.file }} to ${{ env.SODIUM_VERSION }}
pull: '--rebase --autostash'
push: true