I have a GitHub Actions workflow dealing with new releases. Some last steps build the application for different platforms. Instead of creating multiple steps where each one builds for a different platform or creating a step running multiple commands I'm looking for a way to loop a step for each item in an array.
I know there is a matrix for jobs so this is my pseudo implementation to show what I'm looking for:
jobs:
do_it:
runs-on: ubuntu-latest
steps:
- name: For each entry in the array...
strategy:
matrix:
target: [ this, that, something ]
run: echo ${{ matrix.target }}
Is it possible to create something similar to a matrix so it will loop the step multiple times?
As a side note, I know there is a similar question but I don't want to split the job into multiple jobs because then I have to deal with all the build artifacts.