From 5f4d0f61e7a1c9a18df73784fa345f96e174090e Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Mon, 13 Jan 2025 13:54:40 +0300 Subject: [PATCH] update CI runners Signed-off-by: onur-ozkan --- .github/workflows/dev-build.yml | 164 ++++++++++++---------------- .github/workflows/release-build.yml | 150 ++++++++++--------------- 2 files changed, 127 insertions(+), 187 deletions(-) diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 8877bb518f..cc3b541969 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -10,7 +10,6 @@ concurrency: env: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - MANUAL_MM_VERSION: true JEMALLOC_SYS_WITH_MALLOC_CONF: "background_thread:true,narenas:1,tcache:false,dirty_decay_ms:0,muzzy_decay_ms:0,metadata_thp:auto" jobs: @@ -38,29 +37,26 @@ jobs: with: deps: ('protoc') - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build - run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - cargo build --release + run: cargo build --release - name: Compress mm2 build output env: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - NAME="mm2_$COMMIT_HASH-linux-x86-64.zip" + NAME="mm2_$KDF_BUILD_TAG-linux-x86-64.zip" zip $NAME target/release/mm2 -j mkdir $BRANCH_NAME mv $NAME ./$BRANCH_NAME/ @@ -70,7 +66,7 @@ jobs: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - NAME="kdf_$COMMIT_HASH-linux-x86-64.zip" + NAME="kdf_$KDF_BUILD_TAG-linux-x86-64.zip" zip $NAME target/release/kdf -j mv $NAME ./$BRANCH_NAME/ @@ -90,7 +86,7 @@ jobs: - name: Build and push container image if: github.event_name != 'pull_request' && github.ref == 'refs/heads/dev' run: | - CONTAINER_TAG="dev-$COMMIT_HASH" + CONTAINER_TAG="dev-$KDF_BUILD_TAG" docker build -t komodoofficial/komodo-defi-framework:"$CONTAINER_TAG" -t komodoofficial/komodo-defi-framework:dev-latest -f .docker/Dockerfile.dev-release . docker push komodoofficial/komodo-defi-framework:"$CONTAINER_TAG" docker push komodoofficial/komodo-defi-framework:dev-latest @@ -111,29 +107,26 @@ jobs: with: deps: ('protoc', 'python3', 'paramiko') - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build - run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - cargo build --release --target x86_64-apple-darwin + run: cargo build --release --target x86_64-apple-darwin - name: Compress mm2 build output env: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - NAME="mm2_$COMMIT_HASH-mac-x86-64.zip" + NAME="mm2_$KDF_BUILD_TAG-mac-x86-64.zip" zip $NAME target/x86_64-apple-darwin/release/mm2 -j mkdir $BRANCH_NAME mv $NAME ./$BRANCH_NAME/ @@ -143,7 +136,7 @@ jobs: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - NAME="kdf_$COMMIT_HASH-mac-x86-64.zip" + NAME="kdf_$KDF_BUILD_TAG-mac-x86-64.zip" zip $NAME target/x86_64-apple-darwin/release/kdf -j mv $NAME ./$BRANCH_NAME/ @@ -172,29 +165,26 @@ jobs: with: deps: ('protoc', 'python3', 'paramiko') - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build - run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - cargo build --release --target aarch64-apple-darwin + run: cargo build --release --target aarch64-apple-darwin - name: Compress mm2 build output env: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - NAME="mm2_$COMMIT_HASH-mac-arm64.zip" + NAME="mm2_$KDF_BUILD_TAG-mac-arm64.zip" zip $NAME target/aarch64-apple-darwin/release/mm2 -j mkdir $BRANCH_NAME mv $NAME ./$BRANCH_NAME/ @@ -204,7 +194,7 @@ jobs: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - NAME="kdf_$COMMIT_HASH-mac-arm64.zip" + NAME="kdf_$KDF_BUILD_TAG-mac-arm64.zip" zip $NAME target/aarch64-apple-darwin/release/kdf -j mv $NAME ./$BRANCH_NAME/ @@ -232,31 +222,26 @@ jobs: with: deps: ('protoc', 'python3', 'paramiko') - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $Env:GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $Env:GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $Env:GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $Env:GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build - run: | - if (test-path "./MM_VERSION") { - remove-item "./MM_VERSION" - } - echo $Env:COMMIT_HASH > ./MM_VERSION - cargo build --release + run: cargo build --release - name: Compress mm2 build output env: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - $NAME="mm2_$Env:COMMIT_HASH-win-x86-64.zip" + $NAME="mm2_$Env:KDF_BUILD_TAG-win-x86-64.zip" 7z a $NAME .\target\release\mm2.exe .\target\release\*.dll mkdir $Env:BRANCH_NAME mv $NAME ./$Env:BRANCH_NAME/ @@ -266,7 +251,7 @@ jobs: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - $NAME="kdf_$Env:COMMIT_HASH-win-x86-64.zip" + $NAME="kdf_$Env:KDF_BUILD_TAG-win-x86-64.zip" 7z a $NAME .\target\release\kdf.exe .\target\release\*.dll mv $NAME ./$Env:BRANCH_NAME/ @@ -295,29 +280,26 @@ jobs: with: deps: ('protoc', 'python3', 'paramiko') - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build - run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - cargo rustc --target x86_64-apple-darwin --lib --release --package mm2_bin_lib --crate-type=staticlib + run: cargo rustc --target x86_64-apple-darwin --lib --release --package mm2_bin_lib --crate-type=staticlib - name: Compress mm2 build output env: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - NAME="mm2_$COMMIT_HASH-mac-dylib-x86-64.zip" + NAME="mm2_$KDF_BUILD_TAG-mac-dylib-x86-64.zip" cp target/x86_64-apple-darwin/release/libkdflib.a target/x86_64-apple-darwin/release/libmm2.a zip $NAME target/x86_64-apple-darwin/release/libmm2.a -j mkdir $BRANCH_NAME @@ -328,7 +310,7 @@ jobs: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - NAME="kdf_$COMMIT_HASH-mac-dylib-x86-64.zip" + NAME="kdf_$KDF_BUILD_TAG-mac-dylib-x86-64.zip" mv target/x86_64-apple-darwin/release/libkdflib.a target/x86_64-apple-darwin/release/libkdf.a zip $NAME target/x86_64-apple-darwin/release/libkdf.a -j mv $NAME ./$BRANCH_NAME/ @@ -371,29 +353,26 @@ jobs: # TODO: Lock wasm-pack version run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build - run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - wasm-pack build --release mm2src/mm2_bin_lib --target web --out-dir ../../target/target-wasm-release + run: wasm-pack build --release mm2src/mm2_bin_lib --target web --out-dir ../../target/target-wasm-release - name: Compress build output env: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - NAME="kdf_$COMMIT_HASH-wasm.zip" + NAME="kdf_$KDF_BUILD_TAG-wasm.zip" (cd ./target/target-wasm-release && zip -r - .) > $NAME mkdir $BRANCH_NAME mv $NAME ./$BRANCH_NAME/ @@ -423,29 +402,26 @@ jobs: with: deps: ('protoc', 'python3', 'paramiko') - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build - run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - cargo rustc --target aarch64-apple-ios --lib --release --package mm2_bin_lib --crate-type=staticlib + run: cargo rustc --target aarch64-apple-ios --lib --release --package mm2_bin_lib --crate-type=staticlib - name: Compress mm2 build output env: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - NAME="mm2_$COMMIT_HASH-ios-aarch64.zip" + NAME="mm2_$KDF_BUILD_TAG-ios-aarch64.zip" cp target/aarch64-apple-ios/release/libkdflib.a target/aarch64-apple-ios/release/libmm2.a zip $NAME target/aarch64-apple-ios/release/libmm2.a -j mkdir $BRANCH_NAME @@ -456,7 +432,7 @@ jobs: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - NAME="kdf_$COMMIT_HASH-ios-aarch64.zip" + NAME="kdf_$KDF_BUILD_TAG-ios-aarch64.zip" mv target/aarch64-apple-ios/release/libkdflib.a target/aarch64-apple-ios/release/libkdf.a zip $NAME target/aarch64-apple-ios/release/libkdf.a -j mv $NAME ./$BRANCH_NAME/ @@ -498,22 +474,19 @@ jobs: - name: Setup NDK run: ./scripts/ci/android-ndk.sh x86 23 - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - export PATH=$PATH:/android-ndk/bin CC_aarch64_linux_android=aarch64-linux-android21-clang CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android21-clang cargo rustc --target=aarch64-linux-android --lib --release --crate-type=staticlib --package mm2_bin_lib @@ -522,7 +495,7 @@ jobs: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - NAME="mm2_$COMMIT_HASH-android-aarch64.zip" + NAME="mm2_$KDF_BUILD_TAG-android-aarch64.zip" cp target/aarch64-linux-android/release/libkdflib.a target/aarch64-linux-android/release/libmm2.a zip $NAME target/aarch64-linux-android/release/libmm2.a -j mkdir $BRANCH_NAME @@ -533,7 +506,7 @@ jobs: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - NAME="kdf_$COMMIT_HASH-android-aarch64.zip" + NAME="kdf_$KDF_BUILD_TAG-android-aarch64.zip" mv target/aarch64-linux-android/release/libkdflib.a target/aarch64-linux-android/release/libkdf.a zip $NAME target/aarch64-linux-android/release/libkdf.a -j mv $NAME ./$BRANCH_NAME/ @@ -575,22 +548,19 @@ jobs: - name: Setup NDK run: ./scripts/ci/android-ndk.sh x86 23 - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - export PATH=$PATH:/android-ndk/bin CC_armv7_linux_androideabi=armv7a-linux-androideabi21-clang CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=armv7a-linux-androideabi21-clang cargo rustc --target=armv7-linux-androideabi --lib --release --crate-type=staticlib --package mm2_bin_lib @@ -599,7 +569,7 @@ jobs: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - NAME="mm2_$COMMIT_HASH-android-armv7.zip" + NAME="mm2_$KDF_BUILD_TAG-android-armv7.zip" cp target/armv7-linux-androideabi/release/libkdflib.a target/armv7-linux-androideabi/release/libmm2.a zip $NAME target/armv7-linux-androideabi/release/libmm2.a -j mkdir $BRANCH_NAME @@ -610,7 +580,7 @@ jobs: AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} if: ${{ env.AVAILABLE != '' }} run: | - NAME="kdf_$COMMIT_HASH-android-armv7.zip" + NAME="kdf_$KDF_BUILD_TAG-android-armv7.zip" mv target/armv7-linux-androideabi/release/libkdflib.a target/armv7-linux-androideabi/release/libkdf.a zip $NAME target/armv7-linux-androideabi/release/libkdf.a -j mv $NAME ./$BRANCH_NAME/ @@ -640,13 +610,13 @@ jobs: echo "/usr/bin" >> $GITHUB_PATH echo "/root/.cargo/bin" >> $GITHUB_PATH - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Activate SSH uses: webfactory/ssh-agent@v0.5.4 @@ -658,10 +628,10 @@ jobs: git clone git@github.com:KomodoPlatform/atomicdex-deployments.git if [ -d "atomicdex-deployments/atomicDEX-API" ]; then cd atomicdex-deployments/atomicDEX-API - sed -i "1s/^.*$/$COMMIT_HASH/" .commit + sed -i "1s/^.*$/$KDF_BUILD_TAG/" .commit git config --global user.email "linuxci@komodoplatform.com" git config --global user.name "linuxci" git add .commit - git commit -m "[atomicDEX-API] $COMMIT_HASH is committed for git & container registry" + git commit -m "[atomicDEX-API] $KDF_BUILD_TAG is committed for git & container registry" git push fi diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index cae080b3d9..f1cdda82df 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -10,7 +10,6 @@ concurrency: env: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - MANUAL_MM_VERSION: true JEMALLOC_SYS_WITH_MALLOC_CONF: "background_thread:true,narenas:1,tcache:false,dirty_decay_ms:0,muzzy_decay_ms:0,metadata_thp:auto" jobs: @@ -38,33 +37,30 @@ jobs: with: deps: ('protoc') - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build - run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - cargo build --release + run: cargo build --release - name: Compress mm2 build output run: | - NAME="mm2_$COMMIT_HASH-linux-x86-64.zip" + NAME="mm2_$KDF_BUILD_TAG-linux-x86-64.zip" zip $NAME target/release/mm2 -j mkdir $BRANCH_NAME mv $NAME ./$BRANCH_NAME/ - name: Compress kdf build output run: | - NAME="kdf_$COMMIT_HASH-linux-x86-64.zip" + NAME="kdf_$KDF_BUILD_TAG-linux-x86-64.zip" zip $NAME target/release/kdf -j mv $NAME ./$BRANCH_NAME/ @@ -102,33 +98,30 @@ jobs: with: deps: ('protoc', 'python3', 'paramiko') - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build - run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - cargo build --release --target x86_64-apple-darwin + run: cargo build --release --target x86_64-apple-darwin - name: Compress mm2 build output run: | - NAME="mm2_$COMMIT_HASH-mac-x86-64.zip" + NAME="mm2_$KDF_BUILD_TAG-mac-x86-64.zip" zip $NAME target/x86_64-apple-darwin/release/mm2 -j mkdir $BRANCH_NAME mv $NAME ./$BRANCH_NAME/ - name: Compress kdf build output run: | - NAME="kdf_$COMMIT_HASH-mac-x86-64.zip" + NAME="kdf_$KDF_BUILD_TAG-mac-x86-64.zip" zip $NAME target/x86_64-apple-darwin/release/kdf -j mv $NAME ./$BRANCH_NAME/ @@ -157,33 +150,30 @@ jobs: with: deps: ('protoc', 'python3', 'paramiko') - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build - run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - cargo build --release --target aarch64-apple-darwin + run: cargo build --release --target aarch64-apple-darwin - name: Compress mm2 build output run: | - NAME="mm2_$COMMIT_HASH-mac-arm64.zip" + NAME="mm2_$KDF_BUILD_TAG-mac-arm64.zip" zip $NAME target/aarch64-apple-darwin/release/mm2 -j mkdir $BRANCH_NAME mv $NAME ./$BRANCH_NAME/ - name: Compress kdf build output run: | - NAME="kdf_$COMMIT_HASH-mac-arm64.zip" + NAME="kdf_$KDF_BUILD_TAG-mac-arm64.zip" zip $NAME target/aarch64-apple-darwin/release/kdf -j mv $NAME ./$BRANCH_NAME/ @@ -211,35 +201,30 @@ jobs: with: deps: ('protoc', 'python3', 'paramiko') - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $Env:GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $Env:GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $Env:GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $Env:GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build - run: | - if (test-path "./MM_VERSION") { - remove-item "./MM_VERSION" - } - echo $Env:COMMIT_HASH > ./MM_VERSION - cargo build --release + run: cargo build --release - name: Compress mm2 build output run: | - $NAME="mm2_$Env:COMMIT_HASH-win-x86-64.zip" + $NAME="mm2_$Env:KDF_BUILD_TAG-win-x86-64.zip" 7z a $NAME .\target\release\mm2.exe .\target\release\*.dll mkdir $Env:BRANCH_NAME mv $NAME ./$Env:BRANCH_NAME/ - name: Compress kdf build output run: | - $NAME="kdf_$Env:COMMIT_HASH-win-x86-64.zip" + $NAME="kdf_$Env:KDF_BUILD_TAG-win-x86-64.zip" 7z a $NAME .\target\release\kdf.exe .\target\release\*.dll mv $NAME ./$Env:BRANCH_NAME/ @@ -267,26 +252,23 @@ jobs: with: deps: ('protoc', 'python3', 'paramiko') - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build - run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - cargo rustc --target x86_64-apple-darwin --lib --release --package mm2_bin_lib --crate-type=staticlib + run: cargo rustc --target x86_64-apple-darwin --lib --release --package mm2_bin_lib --crate-type=staticlib - name: Compress mm2 build output run: | - NAME="mm2_$COMMIT_HASH-mac-dylib-x86-64.zip" + NAME="mm2_$KDF_BUILD_TAG-mac-dylib-x86-64.zip" cp target/x86_64-apple-darwin/release/libkdflib.a target/x86_64-apple-darwin/release/libmm2.a zip $NAME target/x86_64-apple-darwin/release/libmm2.a -j mkdir $BRANCH_NAME @@ -294,7 +276,7 @@ jobs: - name: Compress kdf build output run: | - NAME="kdf_$COMMIT_HASH-mac-dylib-x86-64.zip" + NAME="kdf_$KDF_BUILD_TAG-mac-dylib-x86-64.zip" mv target/x86_64-apple-darwin/release/libkdflib.a target/x86_64-apple-darwin/release/libkdf.a zip $NAME target/x86_64-apple-darwin/release/libkdf.a -j mv $NAME ./$BRANCH_NAME/ @@ -337,26 +319,23 @@ jobs: # TODO: Lock wasm-pack version run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build - run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - wasm-pack build --release mm2src/mm2_bin_lib --target web --out-dir ../../target/target-wasm-release + run: wasm-pack build --release mm2src/mm2_bin_lib --target web --out-dir ../../target/target-wasm-release - name: Compress build output run: | - NAME="kdf_$COMMIT_HASH-wasm.zip" + NAME="kdf_$KDF_BUILD_TAG-wasm.zip" (cd ./target/target-wasm-release && zip -r - .) > $NAME mkdir $BRANCH_NAME mv $NAME ./$BRANCH_NAME/ @@ -386,26 +365,23 @@ jobs: with: deps: ('protoc', 'python3', 'paramiko') - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build - run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - cargo rustc --target aarch64-apple-ios --lib --release --package mm2_bin_lib --crate-type=staticlib + run: cargo rustc --target aarch64-apple-ios --lib --release --package mm2_bin_lib --crate-type=staticlib - name: Compress mm2 build output run: | - NAME="mm2_$COMMIT_HASH-ios-aarch64.zip" + NAME="mm2_$KDF_BUILD_TAG-ios-aarch64.zip" mv target/aarch64-apple-ios/release/libkdflib.a target/aarch64-apple-ios/release/libmm2.a zip $NAME target/aarch64-apple-ios/release/libmm2.a -j mkdir $BRANCH_NAME @@ -413,7 +389,7 @@ jobs: - name: Compress kdf build output run: | - NAME="kdf_$COMMIT_HASH-ios-aarch64.zip" + NAME="kdf_$KDF_BUILD_TAG-ios-aarch64.zip" mv target/aarch64-apple-ios/release/libkdflib.a target/aarch64-apple-ios/release/libkdf.a zip $NAME target/aarch64-apple-ios/release/libkdf.a -j mv $NAME ./$BRANCH_NAME/ @@ -455,28 +431,25 @@ jobs: - name: Setup NDK run: ./scripts/ci/android-ndk.sh x86 23 - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - export PATH=$PATH:/android-ndk/bin CC_aarch64_linux_android=aarch64-linux-android21-clang CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android21-clang cargo rustc --target=aarch64-linux-android --lib --release --crate-type=staticlib --package mm2_bin_lib - name: Compress mm2 build output run: | - NAME="mm2_$COMMIT_HASH-android-aarch64.zip" + NAME="mm2_$KDF_BUILD_TAG-android-aarch64.zip" mv target/aarch64-linux-android/release/libkdflib.a target/aarch64-linux-android/release/libmm2.a zip $NAME target/aarch64-linux-android/release/libmm2.a -j mkdir $BRANCH_NAME @@ -484,7 +457,7 @@ jobs: - name: Compress kdf build output run: | - NAME="kdf_$COMMIT_HASH-android-aarch64.zip" + NAME="kdf_$KDF_BUILD_TAG-android-aarch64.zip" mv target/aarch64-linux-android/release/libkdflib.a target/aarch64-linux-android/release/libkdf.a zip $NAME target/aarch64-linux-android/release/libkdf.a -j mv $NAME ./$BRANCH_NAME/ @@ -526,28 +499,25 @@ jobs: - name: Setup NDK run: ./scripts/ci/android-ndk.sh x86 23 - - name: Calculate commit hash for PR commit + - name: Calculate build tag (commit hash) for PR commit if: github.event_name == 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV - - name: Calculate commit hash for merge commit + - name: Calculate build tag (commit hash) for merge commit if: github.event_name != 'pull_request' - run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + run: echo "KDF_BUILD_TAG=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Build cache uses: ./.github/actions/build-cache - name: Build run: | - rm -f ./MM_VERSION - echo $COMMIT_HASH > ./MM_VERSION - export PATH=$PATH:/android-ndk/bin CC_armv7_linux_androideabi=armv7a-linux-androideabi21-clang CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=armv7a-linux-androideabi21-clang cargo rustc --target=armv7-linux-androideabi --lib --release --crate-type=staticlib --package mm2_bin_lib - name: Compress mm2 build output run: | - NAME="mm2_$COMMIT_HASH-android-armv7.zip" + NAME="mm2_$KDF_BUILD_TAG-android-armv7.zip" mv target/armv7-linux-androideabi/release/libkdflib.a target/armv7-linux-androideabi/release/libmm2.a zip $NAME target/armv7-linux-androideabi/release/libmm2.a -j mkdir $BRANCH_NAME @@ -555,7 +525,7 @@ jobs: - name: Compress kdf build output run: | - NAME="kdf_$COMMIT_HASH-android-armv7.zip" + NAME="kdf_$KDF_BUILD_TAG-android-armv7.zip" mv target/armv7-linux-androideabi/release/libkdflib.a target/armv7-linux-androideabi/release/libkdf.a zip $NAME target/armv7-linux-androideabi/release/libkdf.a -j mv $NAME ./$BRANCH_NAME/