Skip to content

Commit

Permalink
chore: add checkout step
Browse files Browse the repository at this point in the history
  • Loading branch information
npty committed Jun 24, 2024
1 parent 5fde3a1 commit e09e7a6
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 52 deletions.
107 changes: 55 additions & 52 deletions .github/actions/install/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions .github/workflows/publish-to-npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e09e7a6

Please sign in to comment.