diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 0849cca89a..8fb32b9c73 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -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 }} @@ -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 }} @@ -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 diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 75e9262b55..077ffb37b8 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -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 @@ -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" @@ -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" @@ -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