Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add profile #21

Merged
merged 7 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/polkadot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
tag: ${{ github.event.inputs.srtool_tag }}
chain: ${{ matrix.chain }}
workdir: "${{ github.workspace }}/repo"
profile: "production"

- name: Summary
run: |
Expand Down
12 changes: 11 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ inputs:
Location of the runtime in your repo. The default is 'runtime/<chain_name>'
required: false

profile:
description: >
Which profile to use with cargo build.
required: false
default: "release"

outputs:
json:
description: >
Expand Down Expand Up @@ -117,6 +123,9 @@ runs:

echo "BUILD_OPTS=${{ env.BUILD_OPTS }}" >> $GITHUB_ENV

PROFILE=${{ inputs.profile }}
echo "PROFILE=$PROFILE" >> $GITHUB_ENV

PARACHAIN_PALLET_ID=${{ env.PARACHAIN_PALLET_ID }}
PARACHAIN_PALLET_ID=${PARACHAIN_PALLET_ID:-0x01}
AUTHORIZE_UPGRADE_PREFIX=${{ env.AUTHORIZE_UPGRADE_PREFIX }}
Expand All @@ -140,6 +149,7 @@ runs:
echo ℹ️ runtime_dir: ${{ env.RUNTIME_DIR }}
echo ℹ️ build_opts: ${{ env.BUILD_OPTS }}
echo ℹ️ parachain_pallet_id: ${{ env.PARACHAIN_PALLET_ID }}
echo ℹ️ profile: ${{ env.PROFILE }}
echo ℹ️ authorize_upgrade_prefix: ${{ env.AUTHORIZE_UPGRADE_PREFIX }}
echo ℹ️ .git folder: `ls -ald ${{ env.WORKDIR }}/.git`
echo ℹ️ Cargo.toml: `ls -al ${{ env.WORKDIR }}/Cargo.toml`
Expand Down Expand Up @@ -179,7 +189,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 }} -e BUILD_OPTS -e PARACHAIN_PALLET_ID -e AUTHORIZE_UPGRADE_PREFIX -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 -e PARACHAIN_PALLET_ID -e AUTHORIZE_UPGRADE_PREFIX -e PROFILE -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
Expand Down