Skip to content

Commit 301f827

Browse files
authored
Update to use a change check action
1 parent c64d70f commit 301f827

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed

.github/workflows/dargon2_library-builder.yml

+32-31
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,34 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v2
16-
- name: make library
16+
- name: Make library
1717
run: |
1818
git clone https://github.com/P-H-C/phc-winner-argon2.git argon2_library
1919
cd argon2_library
2020
make
21-
- name: push compiled library
21+
- name: Copy Compiled Library
2222
run: |
2323
mkdir -p lib/src/blobs/
2424
cp argon2_library/libargon2.so.1 lib/src/blobs/libargon2-linux.so
25+
- name: Check if there are changes
26+
id: changes
27+
uses: UnicornGlobal/[email protected]
28+
- name: Push if Changed
29+
if: steps.changes.outputs.changed == 1
30+
run: |
2531
git config user.name "Github Actions"
2632
git config user.email "[email protected]"
27-
if git diff-index --quiet HEAD
28-
then
29-
echo "No Changes. Done"
30-
else
31-
git add -f lib/src/blobs/libargon2-linux.so
32-
git commit -m "Create Native Library for Linux"
33-
git push origin main
34-
fi
33+
git add -f lib/src/blobs/libargon2-linux.so
34+
git commit -m "Create Native Library for Linux"
35+
git push origin main
3536
mac-build:
3637
runs-on: macos-latest
3738
needs: linux-build
3839
steps:
3940
- uses: actions/checkout@v2
4041
- name: Get Updated Changes
4142
run: git pull origin main
42-
- name: make library
43+
- name: Make & Copy Library
4344
run: |
4445
git clone https://github.com/P-H-C/phc-winner-argon2.git argon2_library
4546
cd argon2_library
@@ -49,19 +50,19 @@ jobs:
4950
CFLAGS=--target=arm64-apple-macos11 make OPTTARGET=aarch64
5051
mv libargon2.1.dylib libargon2.1-arm64.dylib
5152
lipo -create libargon2.1-x86_64.dylib libargon2.1-arm64.dylib -output libargon2.1.dylib
52-
- name: copy and push library
53-
run: |
53+
cd ..
5454
cp argon2_library/libargon2.1.dylib lib/src/blobs/libargon2-darwin.dylib
55+
- name: Check if there are changes
56+
id: changes
57+
uses: UnicornGlobal/[email protected]
58+
- name: Push if Changed
59+
if: steps.changes.outputs.changed == 1
60+
run: |
5561
git config user.name "Github Actions"
5662
git config user.email "[email protected]"
57-
if git diff-index --quiet HEAD
58-
then
59-
echo "No Changes. Done"
60-
else
61-
git add -f lib/src/blobs/libargon2-darwin.dylib
62-
git commit -m "Create Native Library for Mac"
63-
git push origin main
64-
fi
63+
git add -f lib/src/blobs/libargon2-darwin.dylib
64+
git commit -m "Create Native Library for Mac"
65+
git push origin main
6566
windows-build:
6667
runs-on: windows-latest
6768
needs: [linux-build, mac-build]
@@ -81,16 +82,16 @@ jobs:
8182
git clone https://github.com/P-H-C/phc-winner-argon2.git argon2_library
8283
CD argon2_library
8384
msbuild Argon2.sln /p:Configuration=ReleaseStatic
84-
- name: copy and push library
85+
- name: Copy Library
86+
run: Copy-Item “argon2_library\vs2015\build\Argon2OptDll.dll” -Destination “lib\src\blobs\libargon2-win.dll”
87+
- name: Check if there are changes
88+
id: changes
89+
uses: UnicornGlobal/[email protected]
90+
- name: Push if Changed
91+
if: steps.changes.outputs.changed == 1
8592
run: |
86-
Copy-Item “argon2_library\vs2015\build\Argon2OptDll.dll” -Destination “lib\src\blobs\libargon2-win.dll”
8793
git config user.name "Github Actions"
8894
git config user.email "[email protected]"
89-
if git diff-index --quiet HEAD
90-
then
91-
echo "No Changes. Done"
92-
else
93-
git add -f lib\src\blobs\libargon2-win.dll
94-
git commit -m "Create Native Library for Windows"
95-
git push origin main
96-
fi
95+
git add -f lib\src\blobs\libargon2-win.dll
96+
git commit -m "Create Native Library for Windows"
97+
git push origin main

0 commit comments

Comments
 (0)