Skip to content

Commit

Permalink
Merge branch 'main' of github.com:movementlabsxyz/movement into l-mon…
Browse files Browse the repository at this point in the history
…ninger/revert-workflow-versions
  • Loading branch information
l-monninger committed Sep 26, 2024
2 parents 52c7aa6 + 4947b75 commit bdd370c
Show file tree
Hide file tree
Showing 214 changed files with 17,228 additions and 4,711 deletions.
50 changes: 50 additions & 0 deletions .github/scripts/update_move_toml.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

MOVE_TOML_PATH="protocol-units/bridge/move-modules/Move.toml"

# Initialize Aptos and capture output
INIT_OUTPUT=$(aptos init 2>&1)
echo "$INIT_OUTPUT"

# Extract the account address from the initialization output
ADDRESS=$(echo "$INIT_OUTPUT" | grep -oE '0x[a-f0-9]{64}' | head -1)
if [[ -z "$ADDRESS" ]]; then
echo "Error: Failed to extract the Aptos account address."
exit 1
fi

# Generate a random seed
RANDOM_SEED=$(shuf -i 0-1000000 -n 1)
echo "Seed: $RANDOM_SEED"

# Derive the resource account address using the random seed
RESOURCE_OUTPUT=$(aptos account derive-resource-account-address --address "$ADDRESS" --seed "" --seed-encoding hex 2>&1)
echo "Resource address derivation output: $RESOURCE_OUTPUT"

# Extract the resource address directly
RESOURCE_ADDRESS=$(echo "$RESOURCE_OUTPUT" | grep -oE '[a-f0-9]{64}')

if [[ -z "$RESOURCE_ADDRESS" ]]; then
echo "Error: Failed to extract the resource account address."
exit 1
fi

# Prepend the 0x to the resource address
RESOURCE_ADDRESS="0x$RESOURCE_ADDRESS"

echo "Extracted address: $ADDRESS"
echo "Derived resource address: $RESOURCE_ADDRESS"

# Update the Move.toml file with the addresses
sed -i "s/^resource_addr = \".*\"/resource_addr = \"$RESOURCE_ADDRESS\"/" "$MOVE_TOML_PATH"
sed -i "s/^atomic_bridge = \".*\"/atomic_bridge = \"$RESOURCE_ADDRESS\"/" "$MOVE_TOML_PATH"
sed -i "s/^moveth = \".*\"/moveth = \"$RESOURCE_ADDRESS\"/" "$MOVE_TOML_PATH"
sed -i "s/^master_minter = \".*\"/master_minter = \"$RESOURCE_ADDRESS\"/" "$MOVE_TOML_PATH"
sed -i "s/^minter = \".*\"/minter = \"$RESOURCE_ADDRESS\"/" "$MOVE_TOML_PATH"
sed -i "s/^admin = \".*\"/admin = \"$RESOURCE_ADDRESS\"/" "$MOVE_TOML_PATH"
sed -i "s/^origin_addr = \".*\"/origin_addr = \"$ADDRESS\"/" "$MOVE_TOML_PATH"

echo "Move.toml updated with ADDRESS: $ADDRESS and RESOURCE_ADDRESS: $RESOURCE_ADDRESS"

echo "Contents of $MOVE_TOML_PATH:"
cat "$MOVE_TOML_PATH"
60 changes: 59 additions & 1 deletion .github/workflows/build-push-containers-select.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- synchronize
push:
branches:
- main
- '**'

jobs:

Expand Down Expand Up @@ -485,6 +485,64 @@ jobs:
- name: Build and Push Docker image movement
run: |
./scripts/movement/manifest suzuka-client-e2e-simple-interaction
suzuka-indexer-build:
permissions:
contents: read
packages: write
strategy:
matrix:
architecture: [x86_64, arm64]

runs-on: ${{ matrix.architecture == 'x86_64' && 'buildjet-8vcpu-ubuntu-2204' || 'buildjet-8vcpu-ubuntu-2204-arm' }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Docker Hub to Avoid Rate Limiting
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Build and Push Docker image movement
run: |
./scripts/movement/build-push-image suzuka-indexer
suzuka-indexer-manifest:
permissions:
contents: read
packages: write
needs: suzuka-indexer-build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Docker Hub to Avoid Rate Limiting
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Build and Push Docker image movement
run: |
./scripts/movement/manifest suzuka-indexer
container-checks:
if: github.event.label.name == 'cicd:suzuka-containers' || github.ref == 'refs/heads/main'
Expand Down
Loading

0 comments on commit bdd370c

Please sign in to comment.