Skip to content

Build and Release

Build and Release #12

Workflow file for this run

name: Build and Release
on:
workflow_dispatch:
inputs:
release_tag:
description: 'Release tag (e.g., v1.0.0)'
required: true
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-latest
container:
image: nvidia/cuda:11.8.0-devel-ubuntu22.04
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
apt-get update
apt-get install -y curl build-essential
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build Release
run: cargo build --release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.release_tag }}
release_name: Release ${{ github.event.inputs.release_tag }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/release/nviwatch
asset_name: nviwatch
asset_content_type: application/octet-stream