From 31e0fd5f648b3d554769f0ec6c8bf10b5464a448 Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Mon, 25 Sep 2023 12:05:08 +0200 Subject: [PATCH 1/4] Adds release CI. --- .github/workflows/release.yaml | 47 ++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..d2cbe22 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,47 @@ +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 hub + + - 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' }} + run: | + tar -czvf bellman-cuda.tar.gz ./build + hub release create prerelease-dev-${{ steps.short_sha.outputs.sha_short }} --prerelease \ + -t ${{ github.sha }} -m prerelease-dev-${{ steps.short_sha.outputs.sha_short }} \ + -a ./bellman-cuda.tar.gz prerelease-dev-${{ steps.short_sha.outputs.sha_short }} From 0fdc2ecd93ad452ac511d6000067175b49b8bb38 Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Mon, 25 Sep 2023 12:25:21 +0200 Subject: [PATCH 2/4] Testing prerelease --- .github/workflows/release.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d2cbe22..6fffd09 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -32,16 +32,16 @@ jobs: cmake --build ./build - name: Generate output with commit SHA - if: ${{ github.event_name != 'pull_request' }} + #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' }} + # if: ${{ github.event_name != 'pull_request' }} run: | tar -czvf bellman-cuda.tar.gz ./build - hub release create prerelease-dev-${{ steps.short_sha.outputs.sha_short }} --prerelease \ - -t ${{ github.sha }} -m prerelease-dev-${{ steps.short_sha.outputs.sha_short }} \ - -a ./bellman-cuda.tar.gz prerelease-dev-${{ steps.short_sha.outputs.sha_short }} + 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 From f34d210f3fde11b9e4dd7a4d26bb2446d8f51b9b Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Mon, 25 Sep 2023 12:32:25 +0200 Subject: [PATCH 3/4] Installs gh. --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6fffd09..f4d39c5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,7 +22,7 @@ jobs: steps: - name: Prepare environment run: | - apt update && apt install -y pkg-config libssl-dev libclang-dev gcc g++ cmake git hub + apt update && apt install -y pkg-config libssl-dev libclang-dev gcc g++ cmake git gh - uses: actions/checkout@v3 From 95cc7714903da058156b5ae2dab39eaea080b52f Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Mon, 25 Sep 2023 13:13:48 +0200 Subject: [PATCH 4/4] Adds GITHUB_TOKEN. --- .github/workflows/release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f4d39c5..8969993 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -40,6 +40,8 @@ jobs: - 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 }} \