|
9 | 9 | - published |
10 | 10 |
|
11 | 11 | jobs: |
12 | | - pre-flight-check: |
| 12 | + lint-and-test: |
13 | 13 | uses: |
14 | 14 | ./.github/workflows/pre-release.yml |
15 | 15 | with: |
16 | 16 | build: 'false' |
17 | 17 | release-check: |
18 | 18 | runs-on: self-hosted |
19 | | - needs: pre-flight-check |
| 19 | + needs: lint-and-test |
20 | 20 | outputs: |
21 | 21 | release-id: ${{ steps.get-release-id.outputs.release_id }} |
22 | 22 | steps: |
|
44 | 44 | # Upload assets for different OS and Architecture |
45 | 45 | upload_assets: |
46 | 46 | if: ${{ github.event_name == 'release' }} |
47 | | - needs: [pre-flight-check, release-check] |
| 47 | + needs: release-check |
48 | 48 | strategy: |
49 | 49 | matrix: |
50 | 50 | platform: |
@@ -205,25 +205,27 @@ jobs: |
205 | 205 | steps: |
206 | 206 | - name: Release ID Propagation |
207 | 207 | run: | |
208 | | - if [ -n "${{ needs.pre-flight-check.outputs.release-id }}" ]; then |
209 | | - echo "Release ID propagated: ${{ needs.pre-flight-check.outputs.release-id }}" |
| 208 | + if [ -n "${{ needs.release-check.outputs.release-id }}" ]; then |
| 209 | + echo "Release ID propagated: ${{ needs.release-check.outputs.release-id }}" |
210 | 210 | else |
211 | 211 | echo "Release ID propagation failed. Exiting.." |
212 | 212 | exit 1 |
213 | 213 | fi |
214 | 214 | shell: bash |
215 | | - - shell: bash |
| 215 | + - name: Targeted Release |
216 | 216 | # checks if the `release_for` is part of a comma separated variable in GitHub |
217 | | - # this is to prevent exhausting GH actions, input should be: linux-amd64,darwin-amd64,windows-amd64 |
| 217 | + # this is to prevent exhausting GH actions needlessly |
| 218 | + # sample input for the gh variable `target_os`: linux-amd64,darwin-amd64,windows-amd64 |
218 | 219 | run: | |
219 | 220 | release=true; |
220 | 221 | if [ "${{ vars.target_os }}" ]; then |
221 | 222 | if [[ ",${{ vars.target_os }}," != *",${{ matrix.platform.release_for }},"* ]]; then |
222 | | - echo "Skipping release for ${{ matrix.platform.release_for }}, expected ${{ vars.target_os }}" |
| 223 | + echo "Skipping release for ${{ matrix.platform.release_for }}, expected any of [${{ vars.target_os }}]" |
223 | 224 | release=false; |
224 | 225 | fi |
225 | 226 | fi |
226 | 227 | echo "release=$release" >> $GITHUB_ENV |
| 228 | + shell: bash |
227 | 229 | - uses: actions/checkout@v4 |
228 | 230 | if: env.release == 'true' |
229 | 231 | with: |
@@ -287,5 +289,5 @@ jobs: |
287 | 289 | curl -X POST -H "Authorization: token ${{ secrets.GIT_TOKEN }}" \ |
288 | 290 | -H "Content-Type: application/octet-stream" \ |
289 | 291 | --data-binary @"${{ matrix.platform.name }}" \ |
290 | | - "https://uploads.github.com/repos/${{ github.repository }}/releases/${{ needs.pre-flight-check.outputs.release-id }}/assets?name=${{ matrix.platform.name }}" |
| 292 | + "https://uploads.github.com/repos/${{ github.repository }}/releases/${{ needs.release-check.outputs.release-id }}/assets?name=${{ matrix.platform.name }}" |
291 | 293 | shell: bash |
0 commit comments