From e09e7a6dc271c3ca1eb302e3799a9c8ddb65313a Mon Sep 17 00:00:00 2001 From: npty Date: Mon, 24 Jun 2024 16:36:07 +0700 Subject: [PATCH] chore: add checkout step --- .github/actions/install/action.yaml | 107 +++++++++++++------------- .github/workflows/publish-to-npm.yaml | 6 ++ 2 files changed, 61 insertions(+), 52 deletions(-) diff --git a/.github/actions/install/action.yaml b/.github/actions/install/action.yaml index 5e3d1647..4de57917 100644 --- a/.github/actions/install/action.yaml +++ b/.github/actions/install/action.yaml @@ -2,57 +2,60 @@ name: Install Dependencies description: 'Setup Sui CLI and install dependencies' inputs: - SUI_VERSION: - description: 'The version of Sui CLI to install' - required: true + SUI_VERSION: + description: 'The version of Sui CLI to install' + required: true runs: - using: 'composite' - - steps: - - name: Install Dependencies - run: | - sudo apt-get update - sudo apt-get install -y libpq-dev - - - name: Cache Sui binaries - id: cache-sui - uses: actions/cache@v4 - with: - path: sui-binaries/ - key: sui-${{ input.SUI_VERSION }} - - - name: Download and Install Sui - if: steps.cache-sui.outputs.cache-hit != 'true' - run: | - curl -L -o sui-${{ inputs.SUI_VERSION }}-ubuntu-x86_64.tgz https://github.com/MystenLabs/sui/releases/download/${{ inputs.SUI_VERSION }}/sui-${{ inputs.SUI_VERSION }}-ubuntu-x86_64.tgz - tar -xvf sui-${{ inputs.SUI_VERSION }}-ubuntu-x86_64.tgz - mkdir -p sui-binaries - mv ./sui ./sui-binaries/ - mv ./sui-debug ./sui-binaries/ - rm -rf sui-${{ inputs.SUI_VERSION }}-ubuntu-x86_64.tgz - - - name: Save Sui binaries - if: steps.cache-sui.outputs.cache-hit != 'true' - id: cache-sui-save - uses: actions/cache@v4 - with: - path: sui-binaries/ - key: ${{ steps.cache-sui.outputs.cache-primary-key }} - - - name: Add Sui binaries to PATH - run: | - sudo cp ./sui-binaries/sui /usr/local/bin/sui - sudo cp ./sui-binaries/sui-debug /usr/local/bin/sui-debug - - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: 'npm' - - - name: Install dependencies - run: npm ci + using: 'composite' + + steps: + - name: Debug Action Input + run: echo "SUI_VERSION=${{ inputs.SUI_VERSION }}" + + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y libpq-dev + + - name: Cache Sui binaries + id: cache-sui + uses: actions/cache@v4 + with: + path: sui-binaries/ + key: sui-${{ inputs.SUI_VERSION }} + + - name: Download and Install Sui + if: steps.cache-sui.outputs.cache-hit != 'true' + run: | + curl -L -o sui-${{ inputs.SUI_VERSION }}-ubuntu-x86_64.tgz https://github.com/MystenLabs/sui/releases/download/${{ inputs.SUI_VERSION }}/sui-${{ inputs.SUI_VERSION }}-ubuntu-x86_64.tgz + tar -xvf sui-${{ inputs.SUI_VERSION }}-ubuntu-x86_64.tgz + mkdir -p sui-binaries + mv ./sui ./sui-binaries/ + mv ./sui-debug ./sui-binaries/ + rm -rf sui-${{ inputs.SUI_VERSION }}-ubuntu-x86_64.tgz + + - name: Save Sui binaries + if: steps.cache-sui.outputs.cache-hit != 'true' + id: cache-sui-save + uses: actions/cache@v4 + with: + path: sui-binaries/ + key: sui-${{ inputs.SUI_VERSION }} + + - name: Add Sui binaries to PATH + run: | + sudo cp ./sui-binaries/sui /usr/local/bin/sui + sudo cp ./sui-binaries/sui-debug /usr/local/bin/sui-debug + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 18 + cache: 'npm' + + - name: Install dependencies + run: npm ci diff --git a/.github/workflows/publish-to-npm.yaml b/.github/workflows/publish-to-npm.yaml index 8b2d5f64..8bc9ac74 100644 --- a/.github/workflows/publish-to-npm.yaml +++ b/.github/workflows/publish-to-npm.yaml @@ -13,6 +13,12 @@ jobs: name: 'Publish to NPM' runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Debug Action + run: | + echo "SUI_VERSION=${{ env.SUI_VERSION }}" + ls -al - name: Download Sui CLI binary uses: ./.github/actions/install with: