diff --git a/README.md b/README.md index 0ffe574..daacbb9 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,16 @@ Make sure you store the yml files shown below in your repository under `.github/ ${{ steps.srtool_build.outputs.wasm }} ${{ matrix.chain }}-srtool-digest.json +## Environmental variables +``` +... +uses: chevdor/srtool-actions@v* +env: + BUILD_OPTS: "--features on-chain-release-build" # optional: will be passed to docker srtool run cmd +with: +... +``` + ## Dev notes Due to a [bug in act](https://github.com/nektos/act/issues/655), the defaults defined in the action are not applied. That means **must** pass all the inputs while testing with `act`. diff --git a/README_src.adoc b/README_src.adoc index ea73f1b..7396aab 100644 --- a/README_src.adoc +++ b/README_src.adoc @@ -47,3 +47,16 @@ If your project uses standard values (such as your runtime package being named ` include::examples/index.adoc[leveloffset=+1] include::doc/dev-notes.adoc[] + +== Environmental variables + +[source,bash] +---- + ... + uses: chevdor/srtool-actions@v* + env: + # optional: will be passed to docker srtool run cmd + BUILD_OPTS: "--features on-chain-release-build" + with: + ... +---- diff --git a/action.yml b/action.yml index ce93876..20cde61 100644 --- a/action.yml +++ b/action.yml @@ -115,6 +115,8 @@ runs: PACKAGE=${PACKAGE:-${{ inputs.chain }}'-runtime'} echo "PACKAGE=$PACKAGE" >> $GITHUB_ENV + echo "BUILD_OPTS=${{ env.BUILD_OPTS }}" >> $GITHUB_ENV + echo ::endgroup - id: env_check @@ -129,6 +131,7 @@ runs: echo ℹ️ package: ${{ env.PACKAGE }} echo ℹ️ workdir: ${{ env.WORKDIR }} echo ℹ️ runtime_dir: ${{ env.RUNTIME_DIR }} + echo ℹ️ build_opts: ${{ env.BUILD_OPTS }} echo ℹ️ .git folder: `ls -ald ${{ env.WORKDIR }}/.git` echo ℹ️ Cargo.toml: `ls -al ${{ env.WORKDIR }}/Cargo.toml` @@ -167,7 +170,7 @@ runs: shell: bash run: | echo ::group::Srtool build of chain ${{ inputs.chain }} - CMD="docker run -i --rm -e PACKAGE=${{ env.PACKAGE }} -e RUNTIME_DIR=${{ env.RUNTIME_DIR }} -v ${{ env.WORKDIR }}:/build ${{ env.SRTOOL_IMAGE }} build --app --json -cM" + CMD="docker run -i --rm -e PACKAGE=${{ env.PACKAGE }} -e RUNTIME_DIR=${{ env.RUNTIME_DIR }} -e BUILD_OPTS -v ${{ env.WORKDIR }}:/build ${{ env.SRTOOL_IMAGE }} build --app --json -cM" echo ::debug::build::docker_run $CMD # here we keep streaming the progress and fetch the last line for the json result