diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml index d6198a14..96843c3e 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/release-binary.yml @@ -16,6 +16,11 @@ on: jobs: build_binary: runs-on: ubuntu-latest + + defaults: + run: + working-directory: ./${{ github.event.inputs.chain }} + steps: - name: Checkout uses: actions/checkout@v3 @@ -34,10 +39,10 @@ jobs: run: sudo apt install -y git clang curl libssl-dev llvm libudev-dev protobuf-compiler - name: Install & display rust toolchain - run: cd ${{ github.event.inputs.chain }} && rustup show + run: rustup show - name: Build binary - run: cd ${{ github.event.inputs.chain }} && cargo build --release + run: cargo build --release - name: Add binary to release uses: djnicholson/release-action@v2.11 @@ -45,4 +50,4 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} tag-name: ${{ github.ref_name }} asset-name: '${{ github.event.inputs.chain }}-collator' - file: '${{ github.event.inputs.chain }}/target/release/${{ github.event.inputs.chain }}-collator' + file: 'target/release/${{ github.event.inputs.chain }}-collator' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2744adf..204da107 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,17 @@ jobs: release: name: Build and publish ${{ github.event.inputs.chain }} runs-on: ubuntu-latest + + defaults: + run: + working-directory: ./${{ github.event.inputs.chain }} + steps: + - name: Checkout Codebase + uses: actions/checkout@v3 + with: + submodules: true + - name: Free disk space run: | sudo rm -rf /usr/share/dotnet @@ -54,17 +64,11 @@ jobs: sudo rm -rf "$AGENT_TOOLSDIRECTORY" df -h - # Checkout the codebase - - name: Checkout Codebase - uses: actions/checkout@v3 - with: - submodules: true - - name: Install deps run: sudo apt -y install protobuf-compiler - name: Install & display rust toolchain - run: cd ${{ github.event.inputs.chain }} && rustup show + run: rustup show # Build WASM with Substrate Runtime Tool - name: Srtool build @@ -74,7 +78,7 @@ jobs: BUILD_OPTS: "" with: chain: ${{ github.event.inputs.chain }} - runtime_dir: ${{ matrix.chain }}/runtime + runtime_dir: ./${{ github.event.inputs.chain }}/runtime tag: ${{ github.event.inputs.srtool_image }} # Output the build summary