Skip to content

Commit

Permalink
github actions update binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylquinal committed Jun 21, 2024
1 parent 0dc3813 commit 128b507
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ permissions:
jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 'Set up JDK 22'
uses: oracle-actions/setup-java@v1
with:
website: jdk.java.net
release: 22

- name: Setup phc-winner-argon2
run: |
chmod +x setup.sh
bash setup.sh
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ bin/
.DS_Store

/.idea/
/src/main/resources/
phc-winner-argon2
archive.zip
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ plugins {
group 'com.zylquinal.argon2'
version '2.1.2-SNAPSHOT'

sourceCompatibility = JavaVersion.VERSION_22
targetCompatibility = JavaVersion.VERSION_22

repositories {
mavenCentral()
}
Expand Down
29 changes: 29 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

rm -rf src/main/resources

# check if archive.zip exists
if [ ! -f archive.zip ]; then
echo "Downloading archive.zip"
wget https://github.com/Zylquinal/phc-winner-argon2/releases/download/latest/archive.zip
fi

unzip -o archive.zip -d phc-winner-argon2

mkdir -p src/main/resources
mkdir -p src/main/resources/darwin-aarch64
mkdir -p src/main/resources/darwin-x86-64
mkdir -p src/main/resources/linux-aarch64
mkdir -p src/main/resources/linux-x86-64
mkdir -p src/main/resources/windows-aarch64
mkdir -p src/main/resources/windows-x86-64

cp phc-winner-argon2/aarch64-apple/libargon2.1.dylib src/main/resources/darwin-aarch64/libargon2.dylib
cp phc-winner-argon2/x86_64-apple/libargon2.1.dylib src/main/resources/darwin-x86-64/libargon2.dylib
cp phc-winner-argon2/aarch64-linux/libargon2.so.1 src/main/resources/linux-aarch64/libargon2.so
cp phc-winner-argon2/x86_64-linux/libargon2.so.1 src/main/resources/linux-x86-64/libargon2.so
cp phc-winner-argon2/aarch64-windows/libargon2.dll src/main/resources/windows-aarch64/libargon2.dll
cp phc-winner-argon2/x86_64-windows/libargon2.dll src/main/resources/windows-x86-64/libargon2.dll

rm -rf phc-winner-argon2

Binary file removed src/main/resources/darwin-aarch64/libargon2.dylib
Binary file not shown.
Binary file removed src/main/resources/darwin-x86-64/libargon2.dylib
Binary file not shown.
Binary file removed src/main/resources/linux-aarch64/libargon2.so
Binary file not shown.
Binary file removed src/main/resources/linux-x86-64/libargon2.so
Binary file not shown.
Binary file removed src/main/resources/windows-aarch64/libargon2.dll
Binary file not shown.
Binary file removed src/main/resources/windows-x86-64/libargon2.dll
Binary file not shown.

0 comments on commit 128b507

Please sign in to comment.