Skip to content

Merge pull request #6 from eric9n/main #7

Merge pull request #6 from eric9n/main

Merge pull request #6 from eric9n/main #7

Workflow file for this run

name: "publish"
on:
push:
branches:
- release
# This is the example from the readme.
# 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:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --release
# Set up the GitHub CLI
- name: Install GitHub CLI
run: |
brew install gh
if: matrix.platform == 'macos-latest'
- name: Install GitHub CLI
run: |
sudo apt install -y gh
if: matrix.platform == 'ubuntu-20.04'
- name: Install GitHub CLI
run: |
choco install gh
if: matrix.platform == 'windows-latest'
# Log in to the GitHub CLI
- name: Login to GitHub CLI
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
# Create a release
- name: Create Release
id: create_release
run: |
gh release create ${{ github.ref_name }} \
--title "Release ${{ github.ref_name }}" \
--notes "Release notes for ${{ github.ref_name }}" \
--draft
shell: bash
- name: Rename and prepare binaries for upload
run: |
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"
shell: bash
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.BINARY_PREFIX }}-${{ runner.os }}-${{ runner.arch }}
path: |
${BINARY_PREFIX}*-${RUNNER_OS}-${RUNNER_ARCH}${EXT}