diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 27aeb81a..23f9c148 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,8 @@ name: Build and Test on: push: + branches: [master] + tags: ['*'] pull_request: jobs: @@ -49,3 +51,23 @@ jobs: run: cmake --build ocelot/build - name: Test run: ctest --test-dir ocelot/build --output-on-failure + - uses: actions/upload-artifact@v7 + with: + name: libgpuocelot-${{ runner.os }} + path: ocelot/build/libgpuocelot.${{ runner.os == 'Linux' && 'so' || 'dylib' }} + + release: + needs: test + runs-on: ubuntu-24.04 + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + permissions: + contents: write + steps: + - uses: actions/download-artifact@v8 + with: + path: dist + merge-multiple: true + - name: Create release + env: + GH_TOKEN: ${{ github.token }} + run: gh release create "$GITHUB_REF_NAME" dist/* --repo "$GITHUB_REPOSITORY" --verify-tag --title "$GITHUB_REF_NAME"