|
2 | 2 | name: Build Compiled Assets |
3 | 3 |
|
4 | 4 | on: |
5 | | - pull_request: |
6 | | - branches: |
7 | | - - main |
8 | | - push: |
9 | | - # Pattern matched against refs/tags |
10 | | - tags: |
11 | | - - 'v[0-9]+.[0-9]+.[0-9]+' |
| 5 | + workflow_call: |
| 6 | + inputs: |
| 7 | + release: |
| 8 | + type: boolean |
| 9 | + default: false |
| 10 | + description: "Attach artifacts to a release" |
12 | 11 |
|
13 | 12 | jobs: |
14 | 13 | build_assets: |
@@ -69,12 +68,12 @@ jobs: |
69 | 68 | run: ${{matrix.CMD_BUILD}} |
70 | 69 | - name: Upload a Build Artifact |
71 | 70 | uses: actions/upload-artifact@v4 |
72 | | - if: github.ref_type == 'tag' |
| 71 | + if: inputs.release == false |
73 | 72 | with: |
74 | 73 | name: ${{ matrix.OUT_FILE_NAME }} |
75 | 74 | path: ./dist/${{ matrix.OUT_FILE_NAME }} |
76 | 75 | - name: Upload Release Asset |
77 | | - if: github.ref_type == 'tag' |
| 76 | + if: inputs.release == true |
78 | 77 | id: upload-release-asset |
79 | 78 | uses: svenstaro/upload-release-action@v2 |
80 | 79 | with: |
@@ -119,12 +118,12 @@ jobs: |
119 | 118 | ./scripts/build_${{ matrix.distro_name }}_arm.sh ${{ matrix.distro_name }}_${{ matrix.arch }} |
120 | 119 | - name: Upload a Build Artifact |
121 | 120 | uses: actions/upload-artifact@v4 |
122 | | - if: github.ref_type == 'tag' |
| 121 | + if: inputs.release == false |
123 | 122 | with: |
124 | 123 | name: codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }} |
125 | 124 | path: ./dist/codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }} |
126 | 125 | - name: Upload Release Asset |
127 | | - if: github.ref_type == 'tag' |
| 126 | + if: inputs.release == true |
128 | 127 | id: upload-release-asset |
129 | 128 | uses: svenstaro/upload-release-action@v2 |
130 | 129 | with: |
|
0 commit comments