Skip to content

Commit

Permalink
feat: add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Tranduy1dol committed Aug 22, 2024
1 parent ccdc99c commit afb5844
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/actions/setup_aptos_cli/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Setup Aptos CLI
inputs:
version:
require: true
private-key:
require: false
default: ""
public-key:
require: false
default: ""
address:
require: false
default: ""
rpc-url:
require: false
default: "https://fullnode.testnet.aptoslabs.com"

runs:
using: "composite"
steps:
- name: Download Aptos CLI
uses: robinraju/[email protected]
with:
repository: "aptos-labs/aptos-core"
tag: aptos-cli-v${{ inputs.version }}
fileName: aptos-cli-${{ inputs.version }}-Ubuntu-x86_64.zip
- name: Setup Aptos CLI
shell: bash
run: |
unzip aptos-cli-${{ inputs.version }}-Ubuntu-x86_64.zip
mv ./aptos /usr/local/bin
chmod +x /usr/local/bin/aptos
- name: Setup Aptos Client
shell: bash
if: ${{ inputs.private-key != '' && inputs.public-key != '' && inputs.address != '' }}
run: |
set -e -o pipefail
APTOS_CONFIG_DIR="./.aptos/"
mkdir -p "${APTOS_CONFIG_DIR}"
export APTOS_CONFIG_PATH="${APTOS_CONFIG_DIR}/config.yaml"
export APTOS_REST_URL="${{ inputs.rpc-url }}"
export APTOS_PRIVATE_KEY="${{ inputs.private-key }}"
export APTOS_PUBLIC_KEY="${{ inputs.public-key }}"
export APTOS_ACCOUNT_ADDRESS="${{ inputs.address }}"
envsubst < .github/aptos_cli/config.yaml > ${APTOS_CONFIG_PATH}
7 changes: 7 additions & 0 deletions .github/aptos_cli/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
profiles:
default:
private_key: "${APTOS_PRIVATE_KEY}"
public_key: "${APTOS_PUBLIC_KEY}"
account: "${APTOS_ACCOUNT_ADDRESS}"
rest_url: "${APTOS_REST_URL}"
File renamed without changes.
6 changes: 6 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "daily"

0 comments on commit afb5844

Please sign in to comment.