|
23 | 23 |
|
24 | 24 | # Docs on sharing data between jobs (between VMs): https://help.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts#passing-data-between-jobs-in-a-workflow |
25 | 25 | jobs: |
| 26 | + # This job checks which files have changed, and skips building the installer if only the metadata has changed. |
| 27 | + # Modified from example at https://github.com/dorny/paths-filter#examples |
| 28 | + changes: |
| 29 | + runs-on: ubuntu-latest |
| 30 | + # Required permissions |
| 31 | + permissions: |
| 32 | + pull-requests: read |
| 33 | + # Set job outputs to values from filter step |
| 34 | + outputs: |
| 35 | + build-installer: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/') || steps.filter.outputs.build-installer }} |
| 36 | + steps: |
| 37 | + # Download the repository |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + |
| 40 | + # For pull requests it's not necessary to checkout the code |
| 41 | + - uses: dorny/paths-filter@v3 |
| 42 | + id: filter |
| 43 | + with: |
| 44 | + filters: | |
| 45 | + build-installer: |
| 46 | + - '!((installData.json)|(versionData.json)|(cachedDownloadSizes.json))' |
| 47 | +
|
26 | 48 | # Windows Build |
27 | 49 | windows_build: |
28 | 50 | name: Windows Build |
| 51 | + needs: changes |
| 52 | + if: ${{ needs.changes.outputs.build-installer == 'true' }} |
29 | 53 | runs-on: windows-latest |
30 | 54 | strategy: |
31 | 55 | matrix: |
|
82 | 106 | # Linux/Mac Build |
83 | 107 | linux_mac_build: |
84 | 108 | name: Linux and Mac Build |
85 | | - needs: windows_build |
| 109 | + if: ${{ always() }} # Always run this, even if windows_build or other tasks fail |
| 110 | + needs: [windows_build, changes] |
86 | 111 | runs-on: ubuntu-latest |
87 | 112 | strategy: |
88 | 113 | matrix: |
@@ -116,13 +141,15 @@ jobs: |
116 | 141 |
|
117 | 142 | # Download Windows artifacts |
118 | 143 | - name: Download all Windows .exe artifacts |
| 144 | + if: ${{ needs.changes.outputs.build-installer == 'true' }} |
119 | 145 | uses: actions/download-artifact@v4 |
120 | 146 | with: |
121 | 147 | name: windows-loader-exe |
122 | 148 | path: travis_installer_output |
123 | 149 |
|
124 | 150 | # Run Python Deploy Script |
125 | 151 | - name: Run Deploy Script |
| 152 | + if: ${{ needs.changes.outputs.build-installer == 'true' }} |
126 | 153 | run: python travis_build_script.py |
127 | 154 |
|
128 | 155 | # Publish a release (tagged commits) |
|
0 commit comments