|
43 | 43 |
|
44 | 44 | outputs: |
45 | 45 | should_release: ${{ steps.check.outputs.should_release }} |
| 46 | + tag_name: ${{ steps.tag.outputs.name }} |
46 | 47 |
|
47 | 48 | steps: |
48 | 49 | - id: check |
|
61 | 62 | echo "should_release=false" >> $GITHUB_OUTPUT |
62 | 63 | fi |
63 | 64 |
|
| 65 | + - name: Clone |
| 66 | + if: ${{ steps.check.outputs.should_release == 'true' }} |
| 67 | + id: checkout |
| 68 | + uses: actions/checkout@v6 |
| 69 | + with: |
| 70 | + fetch-depth: 0 |
| 71 | + |
| 72 | + - name: Determine tag name |
| 73 | + if: ${{ steps.check.outputs.should_release == 'true' }} |
| 74 | + id: tag |
| 75 | + uses: ./.github/actions/get-tag-name |
| 76 | + |
| 77 | + - name: Create and push git tag |
| 78 | + if: ${{ steps.check.outputs.should_release == 'true' }} |
| 79 | + run: | |
| 80 | + TAG="${{ steps.tag.outputs.name }}" |
| 81 | + if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null 2>&1; then |
| 82 | + echo "Tag ${TAG} already exists, skipping creation" |
| 83 | + else |
| 84 | + git tag "${TAG}" |
| 85 | + git push origin "${TAG}" |
| 86 | + fi |
| 87 | +
|
64 | 88 | macos-cpu: |
65 | 89 | needs: [check-release, ui-build] |
66 | 90 | if: ${{ needs.check-release.outputs.should_release == 'true' }} |
@@ -129,12 +153,12 @@ jobs: |
129 | 153 | id: pack_artifacts |
130 | 154 | run: | |
131 | 155 | cp LICENSE ./build/bin/ |
132 | | - tar -czvf llama-${{ steps.tag.outputs.name }}-bin-macos-${{ matrix.build }}.tar.gz -s ",^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin . |
| 156 | + tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-macos-${{ matrix.build }}.tar.gz -s ",^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C ./build/bin . |
133 | 157 |
|
134 | 158 | - name: Upload artifacts |
135 | 159 | uses: actions/upload-artifact@v7 |
136 | 160 | with: |
137 | | - path: llama-${{ steps.tag.outputs.name }}-bin-macos-${{ matrix.build }}.tar.gz |
| 161 | + path: llama-${{ needs.check-release.outputs.tag_name }}-bin-macos-${{ matrix.build }}.tar.gz |
138 | 162 | archive: false |
139 | 163 |
|
140 | 164 | - name: ccache-clear |
@@ -212,12 +236,12 @@ jobs: |
212 | 236 | id: pack_artifacts |
213 | 237 | run: | |
214 | 238 | cp LICENSE ./build/bin/ |
215 | | - tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin . |
| 239 | + tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C ./build/bin . |
216 | 240 |
|
217 | 241 | - name: Upload artifacts |
218 | 242 | uses: actions/upload-artifact@v7 |
219 | 243 | with: |
220 | | - path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-${{ matrix.build }}.tar.gz |
| 244 | + path: llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-${{ matrix.build }}.tar.gz |
221 | 245 | archive: false |
222 | 246 |
|
223 | 247 | - name: ccache-clear |
@@ -298,12 +322,12 @@ jobs: |
298 | 322 | id: pack_artifacts |
299 | 323 | run: | |
300 | 324 | cp LICENSE ./build/bin/ |
301 | | - tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin . |
| 325 | + tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C ./build/bin . |
302 | 326 |
|
303 | 327 | - name: Upload artifacts |
304 | 328 | uses: actions/upload-artifact@v7 |
305 | 329 | with: |
306 | | - path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz |
| 330 | + path: llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz |
307 | 331 | archive: false |
308 | 332 |
|
309 | 333 | - name: ccache-clear |
|
0 commit comments