chore: add secrets migration workflow to kdf-internal #8185
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Development builds | |
| on: | |
| push: | |
| branches-ignore: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
| jobs: | |
| linux-x86-64: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| container: komodoofficial/ci-container:latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: pre scripts for ci container | |
| run: | | |
| git config --global --add safe.directory /__w/komodo-defi-framework/komodo-defi-framework | |
| echo "/bin" >> $GITHUB_PATH | |
| echo "/usr/bin" >> $GITHUB_PATH | |
| echo "/root/.cargo/bin" >> $GITHUB_PATH | |
| - name: Install toolchain | |
| run: | | |
| rustup toolchain install stable --no-self-update --profile=minimal | |
| rustup default stable | |
| - name: Install build deps | |
| uses: ./.github/actions/deps-install | |
| with: | |
| deps: ('protoc') | |
| - 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: Build cache | |
| uses: ./.github/actions/build-cache | |
| - name: Build | |
| run: cargo build --release | |
| - name: Compress kdf build output | |
| env: | |
| AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | |
| if: ${{ env.AVAILABLE != '' }} | |
| run: | | |
| NAME="kdf_$KDF_BUILD_TAG-linux-x86-64.zip" | |
| zip $NAME target/release/kdf -j | |
| SAFE_DIR_NAME=$(echo "$BRANCH_NAME" | tr '/' '-') | |
| mkdir $SAFE_DIR_NAME | |
| mv $NAME ./$SAFE_DIR_NAME/ | |
| shasum -a 256 ./$SAFE_DIR_NAME/$NAME | tee ./$SAFE_DIR_NAME/$NAME.sha256 | |
| - 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" | |
| - name: Login to dockerhub | |
| if: github.event_name != 'pull_request' && github.ref == 'refs/heads/dev' | |
| run: docker login --username ${{ secrets.DOCKER_HUB_USERNAME }} --password ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} docker.io | |
| - name: Build and push container image | |
| if: github.event_name != 'pull_request' && github.ref == 'refs/heads/dev' | |
| run: | | |
| CONTAINER_TAG="dev-$KDF_BUILD_TAG" | |
| docker build -t gleec/komodo-defi-framework:"$CONTAINER_TAG" -t gleec/komodo-defi-framework:dev-latest -f .docker/Dockerfile.dev-release . | |
| docker push gleec/komodo-defi-framework:"$CONTAINER_TAG" | |
| docker push gleec/komodo-defi-framework:dev-latest | |
| mac-x86-64: | |
| timeout-minutes: 60 | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install toolchain | |
| run: | | |
| rustup toolchain install stable --no-self-update --profile=minimal | |
| rustup default stable | |
| rustup target add x86_64-apple-darwin | |
| - 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: Build cache | |
| uses: ./.github/actions/build-cache | |
| - 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 }} | |
| if: ${{ env.AVAILABLE != '' }} | |
| run: | | |
| NAME="kdf_$KDF_BUILD_TAG-mac-x86-64.zip" | |
| zip $NAME target/x86_64-apple-darwin/release/kdf -j | |
| SAFE_DIR_NAME=$(echo "$BRANCH_NAME" | tr '/' '-') | |
| mkdir $SAFE_DIR_NAME | |
| mv $NAME ./$SAFE_DIR_NAME/ | |
| shasum -a 256 ./$SAFE_DIR_NAME/$NAME | tee ./$SAFE_DIR_NAME/$NAME.sha256 | |
| - 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" | |
| mac-arm64: | |
| timeout-minutes: 60 | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install toolchain | |
| run: | | |
| rustup toolchain install stable --no-self-update --profile=minimal | |
| rustup default stable | |
| rustup target add aarch64-apple-darwin | |
| - 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: Build cache | |
| uses: ./.github/actions/build-cache | |
| - 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 }} | |
| if: ${{ env.AVAILABLE != '' }} | |
| run: | | |
| NAME="kdf_$KDF_BUILD_TAG-mac-arm64.zip" | |
| zip $NAME target/aarch64-apple-darwin/release/kdf -j | |
| SAFE_DIR_NAME=$(echo "$BRANCH_NAME" | tr '/' '-') | |
| mkdir $SAFE_DIR_NAME | |
| mv $NAME ./$SAFE_DIR_NAME/ | |
| shasum -a 256 ./$SAFE_DIR_NAME/$NAME | tee ./$SAFE_DIR_NAME/$NAME.sha256 | |
| - 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" | |
| 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/ | |
| shasum -a 256 ./$SAFE_DIR_NAME/$NAME | tee ./$SAFE_DIR_NAME/$NAME.sha256 | |
| - 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 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install toolchain | |
| run: | | |
| rustup toolchain install stable --no-self-update --profile=minimal | |
| rustup default stable | |
| - 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 }})" >> $Env: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)" >> $Env:GITHUB_ENV | |
| - name: Build cache | |
| uses: ./.github/actions/build-cache | |
| - name: Build | |
| run: cargo build --release | |
| - name: Compress kdf build output | |
| env: | |
| AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | |
| if: ${{ env.AVAILABLE != '' }} | |
| run: | | |
| $NAME="kdf_$Env:KDF_BUILD_TAG-win-x86-64.zip" | |
| 7z a $NAME .\target\release\kdf.exe | |
| $SAFE_DIR_NAME = $Env:BRANCH_NAME -replace '/', '-' | |
| mkdir $SAFE_DIR_NAME | |
| mv $NAME ./$SAFE_DIR_NAME/ | |
| # Generate the SHA256 hash for the zip file | |
| Get-FileHash ./$SAFE_DIR_NAME/$NAME -Algorithm SHA256 | Format-Table Hash | Out-File "./$SAFE_DIR_NAME/$NAME.sha256" -Encoding ascii | |
| # Display the SHA256 hash in Actions logs | |
| Get-Content "./$SAFE_DIR_NAME/$NAME.sha256" | |
| - 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 = $Env:BRANCH_NAME -replace '/', '-' | |
| python3 ./scripts/ci/upload_artifact.py "$SAFE_BRANCH_NAME" "/uploads/$SAFE_BRANCH_NAME" | |
| mac-dylib-x86-64: | |
| timeout-minutes: 60 | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install toolchain | |
| run: | | |
| rustup toolchain install stable --no-self-update --profile=minimal | |
| rustup default stable | |
| rustup target add x86_64-apple-darwin | |
| - 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: Build cache | |
| uses: ./.github/actions/build-cache | |
| - name: Build | |
| run: cargo rustc --target x86_64-apple-darwin --lib --release --package mm2_bin_lib --crate-type=staticlib | |
| - name: Compress kdf build output | |
| env: | |
| AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | |
| if: ${{ env.AVAILABLE != '' }} | |
| run: | | |
| 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 | |
| SAFE_DIR_NAME=$(echo "$BRANCH_NAME" | tr '/' '-') | |
| mkdir $SAFE_DIR_NAME | |
| mv $NAME ./$SAFE_DIR_NAME/ | |
| shasum -a 256 ./$SAFE_DIR_NAME/$NAME | tee ./$SAFE_DIR_NAME/$NAME.sha256 | |
| - 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" | |
| wasm: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| container: komodoofficial/ci-container:latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: pre scripts for ci container | |
| run: | | |
| git config --global --add safe.directory /__w/komodo-defi-framework/komodo-defi-framework | |
| echo "/bin" >> $GITHUB_PATH | |
| echo "/usr/bin" >> $GITHUB_PATH | |
| echo "/root/.cargo/bin" >> $GITHUB_PATH | |
| - name: Install build deps | |
| uses: ./.github/actions/deps-install | |
| with: | |
| deps: ('protoc') | |
| - name: Install toolchain | |
| run: | | |
| rustup toolchain install stable --no-self-update --profile=minimal | |
| rustup default stable | |
| rustup target add wasm32-unknown-unknown | |
| - name: Install wasm-pack | |
| # TODO: Lock wasm-pack version | |
| run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
| - 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: Build cache | |
| uses: ./.github/actions/build-cache | |
| - name: Build | |
| 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_$KDF_BUILD_TAG-wasm.zip" | |
| (cd ./target/target-wasm-release && zip -r - .) > $NAME | |
| SAFE_DIR_NAME=$(echo "$BRANCH_NAME" | tr '/' '-') | |
| mkdir $SAFE_DIR_NAME | |
| mv $NAME ./$SAFE_DIR_NAME/ | |
| shasum -a 256 ./$SAFE_DIR_NAME/$NAME | tee ./$SAFE_DIR_NAME/$NAME.sha256 | |
| - 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" | |
| ios-aarch64: | |
| timeout-minutes: 60 | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install toolchain | |
| run: | | |
| rustup toolchain install stable --no-self-update --profile=minimal | |
| rustup default stable | |
| rustup target add aarch64-apple-ios | |
| - 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: Build cache | |
| uses: ./.github/actions/build-cache | |
| - name: Build | |
| run: cargo rustc --target aarch64-apple-ios --lib --release --package mm2_bin_lib --crate-type=staticlib | |
| - name: Compress kdf build output | |
| env: | |
| AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | |
| if: ${{ env.AVAILABLE != '' }} | |
| run: | | |
| 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 | |
| SAFE_DIR_NAME=$(echo "$BRANCH_NAME" | tr '/' '-') | |
| mkdir $SAFE_DIR_NAME | |
| mv $NAME ./$SAFE_DIR_NAME/ | |
| shasum -a 256 ./$SAFE_DIR_NAME/$NAME | tee ./$SAFE_DIR_NAME/$NAME.sha256 | |
| - 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" | |
| android-aarch64: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| container: komodoofficial/ci-container:latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: pre scripts for ci container | |
| run: | | |
| git config --global --add safe.directory /__w/komodo-defi-framework/komodo-defi-framework | |
| echo "/bin" >> $GITHUB_PATH | |
| echo "/usr/bin" >> $GITHUB_PATH | |
| echo "/root/.cargo/bin" >> $GITHUB_PATH | |
| - name: Install toolchain | |
| run: | | |
| rustup toolchain install stable --no-self-update --profile=minimal | |
| rustup default stable | |
| rustup target add aarch64-linux-android | |
| - name: Install build deps | |
| uses: ./.github/actions/deps-install | |
| with: | |
| deps: ('protoc') | |
| - name: Setup NDK | |
| run: ./scripts/ci/android-ndk.sh x86 23 | |
| - 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: Build cache | |
| uses: ./.github/actions/build-cache | |
| - name: Build | |
| run: | | |
| 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 kdf build output | |
| env: | |
| AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | |
| if: ${{ env.AVAILABLE != '' }} | |
| run: | | |
| 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 | |
| SAFE_DIR_NAME=$(echo "$BRANCH_NAME" | tr '/' '-') | |
| mkdir $SAFE_DIR_NAME | |
| mv $NAME ./$SAFE_DIR_NAME/ | |
| shasum -a 256 ./$SAFE_DIR_NAME/$NAME | tee ./$SAFE_DIR_NAME/$NAME.sha256 | |
| - 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" | |
| android-armv7: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| container: komodoofficial/ci-container:latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: pre scripts for ci container | |
| run: | | |
| git config --global --add safe.directory /__w/komodo-defi-framework/komodo-defi-framework | |
| echo "/bin" >> $GITHUB_PATH | |
| echo "/usr/bin" >> $GITHUB_PATH | |
| echo "/root/.cargo/bin" >> $GITHUB_PATH | |
| - name: Install toolchain | |
| run: | | |
| rustup toolchain install stable --no-self-update --profile=minimal | |
| rustup default stable | |
| rustup target add armv7-linux-androideabi | |
| - name: Install build deps | |
| uses: ./.github/actions/deps-install | |
| with: | |
| deps: ('protoc') | |
| - name: Setup NDK | |
| run: ./scripts/ci/android-ndk.sh x86 23 | |
| - 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: Build cache | |
| uses: ./.github/actions/build-cache | |
| - name: Build | |
| run: | | |
| 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 kdf build output | |
| env: | |
| AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | |
| if: ${{ env.AVAILABLE != '' }} | |
| run: | | |
| 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 | |
| SAFE_DIR_NAME=$(echo "$BRANCH_NAME" | tr '/' '-') | |
| mkdir $SAFE_DIR_NAME | |
| mv $NAME ./$SAFE_DIR_NAME/ | |
| shasum -a 256 ./$SAFE_DIR_NAME/$NAME | tee ./$SAFE_DIR_NAME/$NAME.sha256 | |
| - 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" | |
| deployment-commitment: | |
| if: github.event_name != 'pull_request' && github.ref == 'refs/heads/dev' | |
| needs: linux-x86-64 | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| container: komodoofficial/ci-container:latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: pre scripts for ci container | |
| run: | | |
| git config --global --add safe.directory /__w/komodo-defi-framework/komodo-defi-framework | |
| echo "/bin" >> $GITHUB_PATH | |
| echo "/usr/bin" >> $GITHUB_PATH | |
| echo "/root/.cargo/bin" >> $GITHUB_PATH | |
| - 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: Activate SSH | |
| uses: webfactory/ssh-agent@v0.5.4 | |
| with: | |
| ssh-private-key: ${{ secrets.ATOMICDEX_DEPLOYMENTS_SSH }} | |
| - name: Commitment | |
| run: | | |
| git clone git@github.com:KomodoPlatform/atomicdex-deployments.git | |
| if [ -d "atomicdex-deployments/atomicDEX-API" ]; then | |
| cd atomicdex-deployments/atomicDEX-API | |
| 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] $KDF_BUILD_TAG is committed for git & container registry" | |
| git push | |
| fi |