-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |