File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Release Binary
1+ name : Release
22
33on :
44 push :
1414
1515jobs :
1616 build :
17- name : Build ${{ matrix.archive }}
17+ name : Build ${{ matrix.target }}
1818 runs-on : ${{ matrix.os }}
1919
2020 strategy :
7171 Copy-Item "target/${{ matrix.target }}/release/${{ matrix.binary }}" "dist/${{ matrix.binary }}"
7272 Compress-Archive -Path "dist/${{ matrix.binary }}" -DestinationPath "${{ matrix.archive }}"
7373
74- - name : Upload artifact
74+ - name : Upload release artifact
7575 uses : actions/upload-artifact@v4
7676 with :
7777 name : ${{ matrix.archive }}
8888 with :
8989 path : artifacts
9090
91- - name : Create release
91+ - name : Create or update release
9292 env :
9393 GH_TOKEN : ${{ github.token }}
9494 run : |
95- gh release create "${GITHUB_REF_NAME}" $(find artifacts -type f) --title "${GITHUB_REF_NAME}" --notes "Automated release for safe-clean ${GITHUB_REF_NAME}"
95+ if gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
96+ gh release upload "${GITHUB_REF_NAME}" \
97+ $(find artifacts -type f) \
98+ --repo "${GITHUB_REPOSITORY}" \
99+ --clobber
100+ else
101+ gh release create "${GITHUB_REF_NAME}" \
102+ $(find artifacts -type f) \
103+ --repo "${GITHUB_REPOSITORY}" \
104+ --title "${GITHUB_REF_NAME}" \
105+ --notes "Automated release for safe-clean ${GITHUB_REF_NAME}"
106+ fi
You can’t perform that action at this time.
0 commit comments