-
Notifications
You must be signed in to change notification settings - Fork 24
49 lines (42 loc) · 1.41 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Build and release
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build_release:
runs-on: [ubuntu-latest]
container:
image: nvidia/cuda:11.8.0-devel-ubuntu22.04
permissions:
contents: write
steps:
- name: Prepare environment
run: |
apt update && apt install -y pkg-config libssl-dev libclang-dev gcc g++ cmake git gh
- uses: actions/checkout@v3
- name: Build
run: |
cmake -B./build -DCMAKE_BUILD_TYPE=Release
cmake --build ./build
- name: Generate output with commit SHA
if: ${{ github.event_name != 'pull_request' }}
id: short_sha
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Create prerelease
if: ${{ github.event_name != 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tar -czvf bellman-cuda.tar.gz ./build
gh release create --prerelease prerelease-dev-${{ steps.short_sha.outputs.sha_short }} \
--target ${{ github.sha }} --title prerelease-dev-${{ steps.short_sha.outputs.sha_short }} \
./bellman-cuda.tar.gz