Skip to content

Commit

Permalink
add repo to wasm meta
Browse files Browse the repository at this point in the history
  • Loading branch information
hawthorne-abendsen committed Nov 14, 2024
1 parent 7a50f10 commit 9fa0ccb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

- name: Run docker container
working-directory: ${{ env.BUILD_DIR_PATH }}
run: docker run --rm -e RELATIVE_PATH=${{ inputs.relative_path }} -e MAKE_TARGET=${{ inputs.make_target }} -e PACKAGE=${{ inputs.package }} -v "${{ env.BUILD_DIR_PATH }}:/inspector/home" ghcr.io/stellar-expert/soroban-build-workflow:v21.5.0
run: docker run --rm -e RELATIVE_PATH=${{ inputs.relative_path }} -e MAKE_TARGET=${{ inputs.make_target }} -e PACKAGE=${{ inputs.package }} -e REPO=github:${{github.event.repository.full_name}} -v "${{ env.BUILD_DIR_PATH }}:/inspector/home" ghcr.io/stellar-expert/soroban-build-workflow:v21.5.0

- name: Get compilation info
working-directory: ${{ env.BUILD_DIR_PATH }}
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ ENV MAKE_TARGET=${MAKE_TARGET}
# Specify the working directory
ENV RELATIVE_PATH=${RELATIVE_PATH}

# Specify the repo
ENV REPO=${REPO}

# Copy entrypoint script
COPY /entrypoint.sh /usr/local/bin/

Expand Down
10 changes: 8 additions & 2 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ if [ "$MAKE_TARGET" ]; then
fi
fi

# Check if repo is defined
if [ ! "$REPO" ]; then
echo "ERROR: REPO is not defined"
exit 1
fi

# Print Rust version
rustc --version

Expand Down Expand Up @@ -59,13 +65,13 @@ fi

# Check if the PACKAGE is defined add it to the build command
if [ "$PACKAGE" ]; then
stellar contract build --package $PACKAGE --out-dir ${OUTPUT}
stellar contract build --package $PACKAGE --out-dir ${OUTPUT} --meta source_repo=$REPO
# Set the package name to the provided package name
PACKAGE_NAME=$PACKAGE
else
# Get the package name from the Cargo.toml file
PACKAGE_NAME=$(grep -m1 '^name =' Cargo.toml | cut -d '"' -f2)
stellar contract build --out-dir ${OUTPUT}
stellar contract build --out-dir ${OUTPUT} --meta source_repo=$REPO
fi

# Verify that the build was successful
Expand Down

0 comments on commit 9fa0ccb

Please sign in to comment.