-
Notifications
You must be signed in to change notification settings - Fork 12
123 lines (120 loc) · 4.09 KB
/
dargon2_library-builder.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
name: Library Builder CI
on:
repository_dispatch:
workflow_dispatch:
defaults:
run:
working-directory: dargon2
jobs:
linux-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Make library
run: |
git clone https://github.com/P-H-C/phc-winner-argon2.git argon2_library
cd argon2_library
make
- name: Copy Compiled Library
run: |
mkdir -p lib/src/blobs/
cp argon2_library/libargon2.so.1 lib/src/blobs/libargon2-linux.so
- name: Check if there are changes
run: |
function check() {
if [[ -z "$(git status --porcelain)" ]];
then
echo "0"
else
echo "1"
fi
}
echo "CHANGED=$(check)" >> $GITHUB_ENV
- name: Push if Changed
if: ${{ env.CHANGED == '1' }}
run: |
git config user.name "Github Actions"
git config user.email "[email protected]"
git add -f lib/src/blobs/libargon2-linux.so
git commit -m "Create Native Library for Linux"
git push origin ${GITHUB_REF##*/}
mac-build:
runs-on: macos-latest
needs: linux-build
steps:
- uses: actions/checkout@v2
- name: Get Updated Changes
run: git pull origin ${GITHUB_REF##*/}
- name: Make & Copy Library
run: |
git clone https://github.com/P-H-C/phc-winner-argon2.git argon2_library
cd argon2_library
make
mv libargon2.1.dylib libargon2.1-x86_64.dylib
make clean
CFLAGS=--target=arm64-apple-macos11 make OPTTARGET=aarch64
mv libargon2.1.dylib libargon2.1-arm64.dylib
lipo -create libargon2.1-x86_64.dylib libargon2.1-arm64.dylib -output libargon2.1.dylib
cd ..
cp argon2_library/libargon2.1.dylib lib/src/blobs/libargon2-darwin.dylib
- name: Check if there are changes
run: |
function check() {
if [[ -z "$(git status --porcelain)" ]];
then
echo "0"
else
echo "1"
fi
}
echo "CHANGED=$(check)" >> $GITHUB_ENV
- name: Push if Changed
if: ${{ env.CHANGED == '1' }}
run: |
git config user.name "Github Actions"
git config user.email "[email protected]"
git add -f lib/src/blobs/libargon2-darwin.dylib
git commit -m "Create Native Library for Mac"
git push origin ${GITHUB_REF##*/}
windows-build:
runs-on: windows-latest
needs: [linux-build, mac-build]
steps:
- uses: actions/checkout@v2
- name: Get Updated Changes
run: git pull origin ${GITHUB_REF##*/}
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Install Windows 8.1 SDK
shell: powershell
run: |
Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?LinkId=323507 -OutFile sdksetup.exe -UseBasicParsing
Start-Process -Wait sdksetup.exe -ArgumentList "/q", "/norestart", "/features", "OptionId.WindowsDesktopSoftwareDevelopmentKit", "OptionId.NetFxSoftwareDevelopmentKit"
- name: make library
run: |
git clone https://github.com/P-H-C/phc-winner-argon2.git argon2_library
CD argon2_library
msbuild Argon2.sln /p:Configuration=ReleaseStatic
- name: Copy Library
run: Copy-Item “argon2_library\vs2015\build\Argon2OptDll.dll” -Destination “lib\src\blobs\libargon2-win.dll”
- name: Check if there are changes
run: |
function check() {
if [[ -z "$(git status --porcelain)" ]];
then
echo "0"
else
echo "1"
fi
}
echo "CHANGED=$(check)" >> $GITHUB_ENV
shell: bash
- name: Push if Changed
if: ${{ env.CHANGED == '1' }}
run: |
git config user.name "Github Actions"
git config user.email "[email protected]"
git add -f lib/src/blobs/libargon2-win.dll
git commit -m "Create Native Library for Windows"
git push origin ${GITHUB_REF##*/}
shell: bash