I have a common task that I need to perform for all job “variants” in a matrixed build. My idea was to use a separate job for that but I’m unsure how to pass a build output between two jobs.
Before needing to do a matrixed build (where we build both versions in parallel), I had been doing this all as one job. My question now is, what is the best way to share information from one job (the newly incremented verison) with the matrixed job that depends on it?
See below for some abberviated code. I haven’t tried to run it yet but I’m sure it will fail since AFAIK you can’t refernce steps from another job. I’m also aware of artifacts but we’re talking about a variable here and not some file.
TIA
jobs:
# increment version, tag and create a release
release:
name: Create Release
...
steps:
- name: Bump version
uses: ...
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
major_version: 62
id: bump_version
build:
name: Build APK
needs: release
...
strategy:
matrix:
flavor: [sandbox,live]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set version
run: ./client/scripts/set-version.sh
env:
NEW_VERSION: ${{ steps.bump_version.outputs.new_version }}
id: set_version