Skip to content

Commit 5d5b804

Browse files
add home_domain to wasm meta
1 parent 8764eba commit 5d5b804

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

.github/workflows/release.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ on:
2323
description: 'Description for the release'
2424
required: false
2525
type: string
26+
home_domain:
27+
description: 'Home domain'
28+
required: false
29+
type: string
2630
secrets:
2731
release_token:
2832
description: 'Github token'
@@ -58,7 +62,7 @@ jobs:
5862

5963
- name: Run docker container
6064
working-directory: ${{ env.BUILD_DIR_PATH }}
61-
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:v22.0.0
65+
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}} -e HOME_DOMAIN=${{inputs.home_domain}} -v "${{ env.BUILD_DIR_PATH }}:/inspector/home" ghcr.io/stellar-expert/soroban-build-workflow:v22.0.0
6266

6367
- name: Get compilation info
6468
working-directory: ${{ env.BUILD_DIR_PATH }}

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ The workflow expects the following inputs in the `with` section:
2626
- `package` (optional) - package name to build, builds contract in working directory by default
2727
- `relative_path` (optional) - relative path to the contract source directory, defaults to the repository root directory
2828
- `make_target` (optional) - make target to invoke, empty by default (useful for contracts with dependencies that must be built before the main contract)
29+
- `release_description` (optional) - release description
30+
- `home_domain` (optional) - home domain for the contract
2931

3032
### Basic workflow for the reporisotry with a single contract
3133

@@ -47,6 +49,7 @@ jobs:
4749
with:
4850
release_name: ${{ github.ref_name }} # use git tag as unique release name
4951
release_description: 'Contract release' # some boring placeholder text to attach
52+
home_domain: 'awesome.com' # home domain for the contract
5053
relative_path: '["src/my-awesome-contract"]' # relative path to your really awesome contract
5154
package: 'my-awesome-contract' # package name to build
5255
make_target: 'build-dependencies' # make target to invoke

docker/Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ ENV RELATIVE_PATH=${RELATIVE_PATH}
6262
# Specify the repo
6363
ENV REPO=${REPO}
6464

65+
# Specify home domain
66+
ENV HOME_DOMAIN=${HOME_DOMAIN}
67+
6568
# Copy entrypoint script
6669
COPY /entrypoint.sh /usr/local/bin/
6770

docker/entrypoint.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,18 @@ if [ $? -ne 0 ]; then
6363
exit 1
6464
fi
6565

66+
# If the HOME_DOMAIN is set, set it to home_domain=HOME_DOMAIN, otherwise set it to an empty string
67+
HOME_DOMAIN=${HOME_DOMAIN:+"--meta home_domain=$HOME_DOMAIN"}
68+
6669
# Check if the PACKAGE is defined add it to the build command
6770
if [ "$PACKAGE" ]; then
68-
stellar contract build --package $PACKAGE --out-dir ${OUTPUT} --meta source_repo=$REPO
71+
stellar contract build --package $PACKAGE --out-dir ${OUTPUT} --meta source_repo=$REPO $HOME_DOMAIN
6972
# Set the package name to the provided package name
7073
PACKAGE_NAME=$PACKAGE
7174
else
7275
# Get the package name from the Cargo.toml file
7376
PACKAGE_NAME=$(grep -m1 '^name =' Cargo.toml | cut -d '"' -f2)
74-
stellar contract build --out-dir ${OUTPUT} --meta source_repo=$REPO
77+
stellar contract build --out-dir ${OUTPUT} --meta source_repo=$REPO $HOME_DOMAIN
7578
fi
7679

7780
# Verify that the build was successful

0 commit comments

Comments
 (0)