summaryrefslogtreecommitdiff
path: root/.github/workflows/release.yml
blob: 98c8c5361f8c5ffcb184aacce512bdf5a9c68a65 (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: CLBlast release

on:
  workflow_dispatch:
    inputs:
      version:
        description: "Version of the form 1.5.3"
        required: true


jobs:

  release_linux_and_macos:

    strategy:
      matrix:
        config: [
          {name: linux, os: ubuntu-20.04, arch: x86_64, c_compiler: gcc-9, cpp_compiler: g++-9},
          {name: macos, os: macos-11, arch: x86_64, c_compiler: clang, cpp_compiler: clang++},
        ]

    runs-on: ${{ matrix.config.os }}

    env:
      RELEASE_NAME: CLBlast-${{ github.event.inputs.version }}-${{ matrix.config.name }}-${{ matrix.config.arch }}

    steps:
    - uses: actions/checkout@v3

    - name: Install requirements for Ubuntu
      run: |
        sudo apt-get update
        sudo apt-get install -yq ocl-icd-opencl-dev opencl-c-headers --no-install-recommends
      if: ${{ matrix.config.name == 'linux' }}

    - name: Run CMake
      run: |
        mkdir ${{env.RELEASE_NAME}}
        export CC=${{ matrix.config.c_compiler }}
        export CXX=${{ matrix.config.cpp_compiler }}
        cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DTESTS=OFF -DCLIENTS=OFF -DSAMPLES=ON -DCMAKE_INSTALL_PREFIX=${{env.RELEASE_NAME}}

    - name: Compile the code
      run: cmake --build build

    - name: Package the code
      run: |
        cmake --build build --target install
        tar -cvf ${{env.RELEASE_NAME}}.tar.gz ${{env.RELEASE_NAME}}

    - name: Upload the release
      uses: actions/upload-artifact@v3
      with:
        name: ${{env.RELEASE_NAME}}
        path: ${{env.RELEASE_NAME}}.tar.gz


  release_windows:

    strategy:
      matrix:
        config: [
          {name: windows, os: windows-2019, arch: x64},
        ]

    runs-on: ${{ matrix.config.os }}

    env:
      RELEASE_NAME: CLBlast-${{ github.event.inputs.version }}-${{ matrix.config.name }}-${{ matrix.config.arch }}

    steps:
    - uses: actions/checkout@v3

    - name: Set up MSVC
      uses: ilammy/msvc-dev-cmd@v1

    - name: Install OpenCL
      run: vcpkg.exe --triplet=${{ matrix.config.arch }}-windows install opencl

    - name: Run CMake
      run: |
        mkdir ${{env.RELEASE_NAME}}
        cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DTESTS=OFF -DCLIENTS=OFF -DSAMPLES=ON -DCMAKE_INSTALL_PREFIX=${{env.RELEASE_NAME}} -DOPENCL_ROOT=C:/vcpkg/packages/opencl_x64-windows

    - name: Compile the code
      run: cmake --build build

    - name: Package the code
      run: |
        cmake --build build --target install
        7z a -r ${{env.RELEASE_NAME}}.7z ${{env.RELEASE_NAME}}

    - name: Upload the release
      uses: actions/upload-artifact@v3
      with:
        name: ${{env.RELEASE_NAME}}
        path: ${{env.RELEASE_NAME}}.7z