Skip to content

Commit

Permalink
Change how the release job is determined
Browse files Browse the repository at this point in the history
Currently if a matrix configuration changes, it might be necessary to
update the 'Release Info' step logic to match. This is not odious since
the matrix configurations and 'Release Info' step are far apart.

To fix this, this includes a new is_release_job configuration to
existing matrix configs that is set immediately below the existing
matrix configurations, and is used in the 'Release Info' step. This
means that if matrix configurations change, it is more likely that we'll
notice to also update the is_release_job config if need.
  • Loading branch information
stevedlawrence committed Oct 5, 2023
1 parent 7fe7738 commit ada7bed
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: [ '8', '11', '17']
os: [ 'ubuntu-latest', 'windows-latest' ]
java_version: [ 8, 11, 17 ]
os: [ ubuntu-latest, windows-latest ]
include:
- is_release_job: false
- is_release_job: true
java_version: 8
os: ubuntu-lastest
steps:

############################################################
Expand Down Expand Up @@ -60,7 +65,7 @@ jobs:
- name: Release Info
id: release_info
run: |
if [[ '${{ github.ref }}' == refs/tags/v* ]] && [[ '${{ matrix.java_version }}' == '8.x' ]] && [[ '${{ matrix.os }}' == 'ubuntu-latest' ]]
if [[ '${{ github.ref }}' == refs/tags/v* ]] && [[ '${{ matrix.is_release_job }}' == 'true' ]]
then
echo ::set-output name=is_release::true
echo ::set-output name=tag::$(echo ${{ github.ref }} | cut -dv -f2)
Expand Down

0 comments on commit ada7bed

Please sign in to comment.