Skip to content

Commit

Permalink
Merge pull request #5 from eric9n/main
Browse files Browse the repository at this point in the history
action
  • Loading branch information
eric9n authored Jan 5, 2024
2 parents ce8bb26 + c21bd25 commit e3fb533
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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}

0 comments on commit e3fb533

Please sign in to comment.