diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 08e205c..f817875 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,6 +9,7 @@ on: # On each push to the `release` branch it will create or update a GitHub release, build your app, and upload the artifacts to the release. env: CARGO_TERM_COLOR: always + BINARY_PREFIX: ncbi jobs: build-and-release: @@ -55,17 +56,20 @@ jobs: --draft shell: bash - - name: Prepare asset name - id: prep + - name: Rename and prepare binaries for upload run: | - echo "ASSET_NAME=ncbi$(if [ ${{ runner.os }} = 'Windows' ]; then echo '.exe'; fi)" >> $GITHUB_ENV - shell: bash + EXT="" + if [ "${{ runner.os }}" = "Windows" ]; then + EXT=".exe" + fi + for file in "${BINARY_PREFIX}"*; do + mv "$file" "${file}-${RUNNER_OS}-${RUNNER_ARCH}${EXT}" + done + echo "Renamed binaries for upload" - - name: Upload Release Asset - run: | - gh release upload ${{ github.ref_name }} \ - ./target/release/${{ env.ASSET_NAME }} \ - --clobber - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - shell: bash + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: binaries-${{ runner.os }}-${{ runner.arch }} + path: | + ${BINARY_PREFIX}*-${RUNNER_OS}-${RUNNER_ARCH}${EXT}