|
18 | 18 | runs-on: ubuntu-latest
|
19 | 19 | outputs:
|
20 | 20 | should_build: ${{ steps.check_commit.outputs.should_build }}
|
| 21 | + should_build_3_4_asan: ${{ steps.check_commit.outputs.should_build_3_4_asan }} |
21 | 22 | commit: ${{ steps.latest_commit.outputs.commit }}
|
22 | 23 | commit_3_4_asan: ${{ steps.latest_commit_3_4_asan.outputs.commit }}
|
23 | 24 | previous_release: ${{ steps.check_commit.outputs.previous_release }}
|
@@ -50,12 +51,14 @@ jobs:
|
50 | 51 | const latest34ASan = "${{ steps.latest_commit_3_4_asan.outputs.commit }}"
|
51 | 52 | const { owner, repo } = context.repo
|
52 | 53 | let { data: release } = await github.rest.repos.getLatestRelease({ owner, repo })
|
53 |
| - const firstLine = release.body.split('\n')[0] |
54 |
| - const latestReleaseCommit = firstLine.split('@')[1] |
| 54 | + const latestReleaseCommit = release.body.split('\n')[0].split('@')[1] |
| 55 | + // Entry in body may not exist, but if it doesn't the should_build_3_4_asan is still correct |
| 56 | + const latestRelease34ASanCommit = (release.body.split('\n')[1] ?? "").split('@')[1] |
55 | 57 | console.log(`Latest release commit: ${latestReleaseCommit}`)
|
56 | 58 | console.log(`Latest ruby commit: ${latestDevCommit}`)
|
57 | 59 | console.log(`Latest 3.4-asan: ${latest34ASan}`)
|
58 | 60 | core.setOutput('should_build', latestReleaseCommit !== latestDevCommit)
|
| 61 | + core.setOutput('should_build_3_4_asan', latestRelease34ASanCommit !== latest34ASan) |
59 | 62 | core.setOutput('previous_release', release.tag_name)
|
60 | 63 | - name: Compute build and reuse matrix
|
61 | 64 | uses: actions/github-script@v7
|
|
64 | 67 | script: |
|
65 | 68 | const osList = ['ubuntu-20.04', 'ubuntu-22.04', 'ubuntu-24.04', 'ubuntu-22.04-arm', 'ubuntu-24.04-arm', 'macos-13', 'macos-14']
|
66 | 69 | const skipSlow = "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.skip_slow == 'true' }}"
|
| 70 | + const skip34ASan = "${{ steps.check_commit.outputs.should_build_3_4_asan == 'false' }}" |
67 | 71 | const buildMatrix = JSON.stringify(
|
68 | 72 | skipSlow === 'false' ?
|
69 | 73 | { os: osList, name: ['head', 'debug'], include: [{ os: 'ubuntu-24.04', name: 'asan' }, { os: 'ubuntu-24.04', name: '3.4-asan' }] } :
|
|
72 | 76 | core.setOutput('build_matrix', buildMatrix)
|
73 | 77 | const reuseMatrix = JSON.stringify(
|
74 | 78 | skipSlow === 'false' ?
|
75 |
| - { os: ['ubuntu-latest'], name: ['noop'] } : // GitHub doesn't like having an empty matrix, skips jobs that depend on reuse-slow |
| 79 | + (skip34ASan === 'false' ? |
| 80 | + { os: ['ubuntu-latest'], name: ['noop'] } : // GitHub doesn't like having an empty matrix, skips jobs that depend on reuse-slow |
| 81 | + { os: ['ubuntu-24.04'], name: ['3.4-asan'] } |
| 82 | + ) : |
76 | 83 | { os: osList, name: ['debug'], include: [{ os: 'ubuntu-24.04', name: 'asan' }, { os: 'ubuntu-24.04', name: '3.4-asan' }] }
|
77 | 84 | )
|
78 | 85 | core.setOutput('reuse_matrix', reuseMatrix)
|
@@ -101,8 +108,13 @@ jobs:
|
101 | 108 | fi
|
102 | 109 | echo "tag=$tag" >> $GITHUB_OUTPUT
|
103 | 110 | - name: Set release description to built hash
|
104 |
| - run: echo "ruby/ruby@${{ needs.prepare.outputs.commit }}" >> release-description.md |
105 |
| - - name: Append note if buils were reused |
| 111 | + run: echo "master: ruby/ruby@${{ needs.prepare.outputs.commit }}" >> release-description.md |
| 112 | + - name: Set release description to 3.4-asan built hash |
| 113 | + run: echo "3.4-asan: ruby/ruby@${{ needs.prepare.outputs.commit_3_4_asan }}" >> release-description.md |
| 114 | + - name: Append note if 3.4-asan build was reused |
| 115 | + if: ${{ needs.prepare.outputs.should_build_3_4_asan == 'false' }} |
| 116 | + run: echo "Skipped building and reused build from ${{ needs.prepare.outputs.previous_release }} for 3.4-asan ruby" >> release-description.md |
| 117 | + - name: Append note if builds were reused |
106 | 118 | if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.skip_slow == 'true' }}
|
107 | 119 | run: echo "Skipped building and reused builds from ${{ needs.prepare.outputs.previous_release }} for debug and asan rubies" >> release-description.md
|
108 | 120 | - name: Create Release
|
|
0 commit comments