## ## Builds binary assets of stacks-blockchain and creates a named tag github (draft) release ## name: Build Distributable Assets # Only run when: # - manually triggered via the ci.yml workflow with a provided input tag on: workflow_call: inputs: tag: description: "Tag name of this release (x.y.z)" required: true type: string parallel_jobs: description: "Number of parallel binary builds" required: false type: number default: 4 arch: description: "Stringified JSON object listing of platform matrix" required: true type: string jobs: artifact: if: ${{ inputs.tag != '' }} name: Create Artifacts runs-on: ubuntu-latest strategy: max-parallel: ${{ inputs.parallel_jobs }} matrix: platform: ${{ fromJson(inputs.arch) }} steps: - name: Checkout the latest code id: git_checkout uses: actions/checkout@v3 - name: Set Vars id: set_vars run: | echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV echo "GITHUB_REF_SHORT=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Set up Docker Buildx id: setup_buildx uses: docker/setup-buildx-action@v2 - name: Build Binaries id: build_binaries uses: docker/build-push-action@v3 with: file: build-scripts/Dockerfile.${{ matrix.platform }} outputs: type=local,dest=./release/${{ matrix.platform }} build-args: | OS_ARCH=${{ matrix.platform }} GIT_BRANCH=${{ env.GITHUB_REF_SHORT }} GIT_COMMIT=${{ env.GITHUB_SHA_SHORT }} - name: Compress artifact id: compress_artifact run: zip --junk-paths ${{ matrix.platform }} ./release/${{ matrix.platform }}/* - name: Upload artifact id: upload_artifact uses: actions/upload-artifact@v3 with: path: ${{ matrix.platform }}.zip