Merge matrix build artifacts for release

I am using a matrix configuration to compile my project on different platforms and want to merge all the outputs to one single release.

    name: ${{ }}
    runs-on: ${{ matrix.config.os }}

I already uploaded all artifacts to the workflow, but I still need to put them into a new release

    - name: Upload artifacts
      uses: actions/upload-artifact@v2
        name: ${{ matrix.config.artifact }}
        path: build/app*

You could create a job that depends on the jobs that build your artifacts You can then have that job download all of the artifacts using and upload those as release assets.

Hi @thebino,

You can create a new job which needs your matrix jobs, in the new job, you can

  1. Download the artifacts to one folder.
  2. Create a new release with action ‘actions/create-release@v1’.
  3. Use ‘hub release edit’ command to add the asset(your artifacts) to the release
    Code sample as below:
      - name: Create Release          # create a new release v1
        id: create_release
        uses: actions/create-release@v1
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          tag_name: v1
          release_name: Release v1
          draft: false
          prerelease: false
      - name: Attach binaries to release
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          set -x
          for asset in ./bin/*; do               #loop the assets in the bin folder
            assets+=("-a" "$asset")
          hub release edit "${assets[@]}" -m "Release v1" "v1"          # add the assets to the Release v1

Please check my answer in similar ticket here for your reference.

You can use github actions to add assets as well, which you can find in marketplace here.


Thanks, I didn’t knew that I can download ALL artifacts together.
I solved it in a separate job and used a 3rd party action for uploads

    - name: Download artifact
      uses: actions/download-artifact@v2

    - name: Upload to Release
      uses: meeDamian/github-release@2.0
1 Like

Hi @thebino,

Glad to know it’s resolved and thanks for sharing!

Happy coding!