Skip to content
76 changes: 76 additions & 0 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ jobs:
- name: Build
run: cargo build --release --target x86_64-apple-darwin

- name: Upload build for next job
uses: actions/upload-artifact@v4
with:
name: x86_64-apple-darwin-release-kdf
path: target/x86_64-apple-darwin/release/kdf

- name: Compress kdf build output
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
Expand Down Expand Up @@ -167,6 +173,12 @@ jobs:
- name: Build
run: cargo build --release --target aarch64-apple-darwin

- name: Upload build for next job
uses: actions/upload-artifact@v4
with:
name: aarch64-apple-darwin-release-kdf
path: target/aarch64-apple-darwin/release/kdf

- name: Compress kdf build output
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
Expand All @@ -189,6 +201,70 @@ jobs:
SAFE_BRANCH_NAME=$(echo "$BRANCH_NAME" | tr '/' '-')
python3 ./scripts/ci/upload_artifact.py "$SAFE_BRANCH_NAME" "/uploads/$SAFE_BRANCH_NAME"

mac-universal:
timeout-minutes: 60
runs-on: macos-latest
needs: [mac-x86-64, mac-arm64]
steps:
- uses: actions/checkout@v3

- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc', 'python3', 'paramiko')

- name: Calculate build tag (commit hash) for PR commit
if: github.event_name == 'pull_request'
run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV

- name: Calculate build tag (commit hash) for merge commit
if: github.event_name != 'pull_request'
run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Download macos x86_64 build
uses: actions/download-artifact@v5
with:
name: x86_64-apple-darwin-release-kdf
path: target/x86_64-apple-darwin/release

- name: Download macos aarch64 build
uses: actions/download-artifact@v5
with:
name: aarch64-apple-darwin-release-kdf
path: target/aarch64-apple-darwin/release

- name: Make universal kdf build output
run: |
AARCH64_BIN="target/aarch64-apple-darwin/release/kdf"
X86_64_BIN="target/x86_64-apple-darwin/release/kdf"
OUT_DIR="target/universal-apple-darwin/release"
OUT_BIN="$OUT_DIR/kdf"
mkdir -p "$OUT_DIR"
lipo -create "$AARCH64_BIN" "$X86_64_BIN" -output "$OUT_BIN"
lipo -info "$OUT_BIN"

- name: Compress kdf build output
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
run: |
NAME="kdf_$KDF_BUILD_TAG-mac-universal.zip"
zip $NAME target/universal-apple-darwin/release/kdf -j
SAFE_DIR_NAME=$(echo "$BRANCH_NAME" | tr '/' '-')
mkdir $SAFE_DIR_NAME
mv $NAME ./$SAFE_DIR_NAME/

- name: Upload build artifact
env:
FILE_SERVER_HOST: ${{ secrets.FILE_SERVER_HOST }}
FILE_SERVER_USERNAME: ${{ secrets.FILE_SERVER_USERNAME }}
FILE_SERVER_PORT: ${{ secrets.FILE_SERVER_PORT }}
FILE_SERVER_KEY: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.FILE_SERVER_KEY != '' }}
run: |
SAFE_BRANCH_NAME=$(echo "$BRANCH_NAME" | tr '/' '-')
python3 ./scripts/ci/upload_artifact.py "$SAFE_BRANCH_NAME" "/uploads/$SAFE_BRANCH_NAME"

win-x86-64:
timeout-minutes: 60
runs-on: windows-latest
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ jobs:
run: |
rustup toolchain install nightly-2023-06-01 --no-self-update --profile=minimal
rustup default nightly-2023-06-01
rustup target add x86_64-apple-darwin

- name: Install build deps
uses: ./.github/actions/deps-install
Expand All @@ -109,6 +110,12 @@ jobs:
- name: Build
run: cargo build --release --target x86_64-apple-darwin

- name: Upload build for next job
uses: actions/upload-artifact@v4
with:
name: x86_64-apple-darwin-release-kdf
path: target/x86_64-apple-darwin/release/kdf

- name: Compress kdf build output
run: |
NAME="kdf_$KDF_BUILD_TAG-mac-x86-64.zip"
Expand Down Expand Up @@ -158,6 +165,12 @@ jobs:
- name: Build
run: cargo build --release --target aarch64-apple-darwin

- name: Upload build for next job
uses: actions/upload-artifact@v4
with:
name: aarch64-apple-darwin-release-kdf
path: target/aarch64-apple-darwin/release/kdf

- name: Compress kdf build output
run: |
NAME="kdf_$KDF_BUILD_TAG-mac-arm64.zip"
Expand All @@ -177,6 +190,70 @@ jobs:
SAFE_BRANCH_NAME=$(echo "$BRANCH_NAME" | tr '/' '-')
python3 ./scripts/ci/upload_artifact.py "$SAFE_BRANCH_NAME" "/uploads/$SAFE_BRANCH_NAME"

mac-universal:
timeout-minutes: 60
runs-on: macos-latest
needs: [mac-x86-64, mac-arm64]
steps:
- uses: actions/checkout@v3

- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc', 'python3', 'paramiko')

- name: Calculate build tag (commit hash) for PR commit
if: github.event_name == 'pull_request'
run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV

- name: Calculate build tag (commit hash) for merge commit
if: github.event_name != 'pull_request'
run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Download macos x86_64 build
uses: actions/download-artifact@v5
with:
name: x86_64-apple-darwin-release-kdf
path: target/x86_64-apple-darwin/release

- name: Download macos aarch64 build
uses: actions/download-artifact@v5
with:
name: aarch64-apple-darwin-release-kdf
path: target/aarch64-apple-darwin/release

- name: Make universal kdf build output
run: |
AARCH64_BIN="target/aarch64-apple-darwin/release/kdf"
X86_64_BIN="target/x86_64-apple-darwin/release/kdf"
OUT_DIR="target/universal-apple-darwin/release"
OUT_BIN="$OUT_DIR/kdf"
mkdir -p "$OUT_DIR"
lipo -create "$AARCH64_BIN" "$X86_64_BIN" -output "$OUT_BIN"
lipo -info "$OUT_BIN"

- name: Compress kdf build output
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
run: |
NAME="kdf_$KDF_BUILD_TAG-mac-universal.zip"
zip $NAME target/universal-apple-darwin/release/kdf -j
SAFE_DIR_NAME=$(echo "$BRANCH_NAME" | tr '/' '-')
mkdir $SAFE_DIR_NAME
mv $NAME ./$SAFE_DIR_NAME/

- name: Upload build artifact
env:
FILE_SERVER_HOST: ${{ secrets.FILE_SERVER_HOST }}
FILE_SERVER_USERNAME: ${{ secrets.FILE_SERVER_USERNAME }}
FILE_SERVER_PORT: ${{ secrets.FILE_SERVER_PORT }}
FILE_SERVER_KEY: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.FILE_SERVER_KEY != '' }}
run: |
SAFE_BRANCH_NAME=$(echo "$BRANCH_NAME" | tr '/' '-')
python3 ./scripts/ci/upload_artifact.py "$SAFE_BRANCH_NAME" "/uploads/$SAFE_BRANCH_NAME"

win-x86-64:
timeout-minutes: 60
runs-on: windows-latest
Expand Down
Loading