Skip to content

Commit ac53a20

Browse files
committed
github action
1 parent f3b4edd commit ac53a20

File tree

3 files changed

+68
-15
lines changed

3 files changed

+68
-15
lines changed

.github/workflows/build.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build and Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_tag:
7+
description: 'Release tag (e.g., v1.0.0)'
8+
required: true
9+
10+
jobs:
11+
build-and-release:
12+
runs-on: ubuntu-latest
13+
container:
14+
image: nvidia/cuda:11.8.0-devel-ubuntu22.04
15+
options: --gpus all
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Install dependencies
21+
run: |
22+
apt-get update
23+
apt-get install -y curl build-essential
24+
25+
- name: Install Rust
26+
uses: actions-rs/toolchain@v1
27+
with:
28+
toolchain: stable
29+
override: true
30+
31+
- name: Build Release
32+
run: cargo build --release
33+
34+
- name: Create Release
35+
id: create_release
36+
uses: actions/create-release@v1
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
with:
40+
tag_name: ${{ github.event.inputs.release_tag }}
41+
release_name: Release ${{ github.event.inputs.release_tag }}
42+
draft: false
43+
prerelease: false
44+
45+
- name: Upload Release Asset
46+
uses: actions/upload-release-asset@v1
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
with:
50+
upload_url: ${{ steps.create_release.outputs.upload_url }}
51+
asset_path: ./target/release/nviwatch
52+
asset_name: nviwatch
53+
asset_content_type: application/octet-stream

Cargo.lock

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "gpu-info-rs"
2+
name = "nviwatch"
33
version = "0.1.0"
44
edition = "2021"
55

0 commit comments

Comments
 (0)