|
18 | 18 |
|
19 | 19 | env: |
20 | 20 | # MicroPython version will be contained in github.event.release.tag_name for releases |
21 | | - RELEASE_FILE: ${{ matrix.name }}-${{ github.event.release.tag_name || github.sha }}-micropython |
| 21 | + CI_RELEASE_FILENAME: ${{ matrix.name }}-${{ github.event.release.tag_name || github.sha }}-micropython |
22 | 22 | CI_PROJECT_ROOT: ${{ github.workspace }}/src-${{ github.sha }} |
23 | 23 | CI_BUILD_ROOT: ${{ github.workspace }} |
24 | 24 | CI_USE_ENV: 1 |
@@ -70,29 +70,30 @@ jobs: |
70 | 70 | python3 -m venv "$CI_BUILD_ROOT/.dir2uf2" |
71 | 71 | source "$CI_BUILD_ROOT/.dir2uf2/bin/activate" |
72 | 72 | ci_cmake_build ${{ matrix.name }} |
73 | | - mv "$CI_BUILD_ROOT/${{ matrix.name }}.uf2" "$CI_BUILD_ROOT/$RELEASE_FILE.uf2" |
74 | | - mv "$CI_BUILD_ROOT/${{ matrix.name }}-with-filesystem.uf2" "$CI_BUILD_ROOT/$RELEASE_FILE-with-filesystem.uf2" |
| 73 | + mv "$CI_BUILD_ROOT/${{ matrix.name }}.uf2" "$CI_BUILD_ROOT/$CI_RELEASE_FILENAME.uf2" |
| 74 | + mv "$CI_BUILD_ROOT/${{ matrix.name }}-with-filesystem.uf2" "$CI_BUILD_ROOT/$CI_RELEASE_FILENAME-with-filesystem.uf2" |
75 | 75 |
|
76 | 76 | - name: "Artifacts: Upload .uf2" |
77 | 77 | uses: actions/upload-artifact@v4 |
78 | 78 | with: |
79 | | - name: ${{ env.RELEASE_FILE }}.uf2 |
80 | | - path: ${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}.uf2 |
| 79 | + name: ${{ env.CI_RELEASE_FILENAME }}.uf2 |
| 80 | + path: ${{ env.CI_BUILD_ROOT }}/${{ env.CI_RELEASE_FILENAME }}.uf2 |
81 | 81 |
|
82 | 82 | - name: "Artifacts: Upload .uf2 (With Filesystem)" |
83 | 83 | uses: actions/upload-artifact@v4 |
84 | 84 | with: |
85 | | - name: ${{ env.RELEASE_FILE }}-with-filesystem.uf2 |
86 | | - path: ${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}-with-filesystem.uf2 |
| 85 | + if-no-files-found: ignore |
| 86 | + name: ${{ env.CI_RELEASE_FILENAME }}-with-filesystem.uf2 |
| 87 | + path: ${{ env.CI_BUILD_ROOT }}/${{ env.CI_RELEASE_FILENAME }}-with-filesystem.uf2 |
87 | 88 |
|
88 | 89 | - name: "Release: Upload .uf2" |
89 | 90 | if: github.event_name == 'release' |
90 | 91 | uses: softprops/action-gh-release@v1 |
91 | 92 | with: |
92 | | - files: ${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}.uf2 |
| 93 | + files: ${{ env.CI_BUILD_ROOT }}/${{ env.CI_RELEASE_FILENAME }}.uf2 |
93 | 94 |
|
94 | 95 | - name: "Release: Upload .uf2 (With Filesystem)" |
95 | | - if: github.event_name == 'release' |
| 96 | + if: ${{ github.event_name == 'release' && hashFiles('${{ env.CI_BUILD_ROOT }}/${{ env.CI_RELEASE_FILENAME }}-with-filesystem.uf2') != '' }} |
96 | 97 | uses: softprops/action-gh-release@v1 |
97 | 98 | with: |
98 | | - files: ${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}-with-filesystem.uf2 |
| 99 | + files: ${{ env.CI_BUILD_ROOT }}/${{ env.CI_RELEASE_FILENAME }}-with-filesystem.uf2 |
0 commit comments