Skip to content

Commit 6e89fdf

Browse files
Initial release scripts (#43)
* Initial release scripts * Release process document * Add CMake version update notes
1 parent 436f081 commit 6e89fdf

4 files changed

Lines changed: 209 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
on:
2+
push:
3+
tags:
4+
- 'v*'
5+
6+
name: Create Release
7+
8+
jobs:
9+
windows-binary:
10+
runs-on: windows-2022
11+
strategy:
12+
matrix:
13+
VER: [v143]
14+
GEN: [Visual Studio 17 2022]
15+
BIN: [x64, x86]
16+
17+
steps:
18+
- name: Checkout OpenCL-SDK
19+
uses: actions/checkout@v2
20+
21+
- name: Initialize git submodules
22+
shell: pwsh
23+
run: |
24+
& git submodule init
25+
& git submodule update
26+
27+
- name: Create Build Environment
28+
shell: pwsh
29+
run: |
30+
# Parallelize MSBuild across projects
31+
[Environment]::SetEnvironmentVariable('UseMultiToolTask', 'true', [EnvironmentVariableTarget]::User)
32+
33+
- name: Configure
34+
shell: pwsh
35+
run: |
36+
$BIN = if('${{matrix.BIN}}' -eq 'x86') {'Win32'} else {'x64'}
37+
& cmake `
38+
-G '${{matrix.GEN}}' `
39+
-A ${BIN} `
40+
-T ${{matrix.VER}} `
41+
-S "${env:GITHUB_WORKSPACE}" `
42+
-B "${env:GITHUB_WORKSPACE}\build" `
43+
-D BUILD_DOCS=OFF `
44+
-D BUILD_TESTING=OFF `
45+
-D BUILD_TESTS=OFF `
46+
-D OPENCL_SDK_BUILD_SAMPLES=OFF `
47+
-D OPENCL_ICD_LOADER_BUILD_TESTING=OFF
48+
49+
- name: Build
50+
shell: pwsh
51+
run: |
52+
& cmake `
53+
--build "${env:GITHUB_WORKSPACE}\build" `
54+
--config Release `
55+
-- `
56+
/verbosity:minimal `
57+
/maxCpuCount `
58+
/noLogo
59+
60+
- name: Install
61+
shell: pwsh
62+
run: |
63+
& cmake `
64+
--install "${env:GITHUB_WORKSPACE}\build" `
65+
--prefix "${env:GITHUB_WORKSPACE}\install" `
66+
--config Release
67+
68+
- name: Package Binary
69+
shell: pwsh
70+
run: |
71+
$BIN = if('${{matrix.BIN}}' -eq 'x86') {'win32'} else {'win64'}
72+
& cpack `
73+
--config "${env:GITHUB_WORKSPACE}\build\CPackConfig.cmake" `
74+
-G ZIP `
75+
-C Release `
76+
-B "${env:GITHUB_WORKSPACE}\package" `
77+
Rename-Item "${env:GITHUB_WORKSPACE}\package\OpenCL-SDK-${{github.ref_name}}-${BIN}.zip" "OpenCL-SDK-${{github.ref_name}}-Win-${{matrix.BIN}}.zip"
78+
79+
- name: Release Binary
80+
uses: softprops/action-gh-release@v1
81+
if: startsWith(github.ref, 'refs/tags/')
82+
with:
83+
draft: true
84+
files: |
85+
package/OpenCL-SDK-${{github.ref_name}}-Win-${{matrix.BIN}}.zip
86+
87+
source:
88+
name: Source Release (${{ matrix.os }})
89+
runs-on: ${{ matrix.os }}
90+
strategy:
91+
matrix:
92+
OS: [ubuntu-20.04, windows-2022]
93+
94+
steps:
95+
- name: Checkout OpenCL-SDK
96+
uses: actions/checkout@v2
97+
98+
- name: Initialize git submodules
99+
shell: pwsh
100+
run: |
101+
& git submodule init
102+
& git submodule update
103+
104+
- name: Configure
105+
shell: pwsh
106+
run: |
107+
& cmake `
108+
-S "${env:GITHUB_WORKSPACE}" `
109+
-B "${env:GITHUB_WORKSPACE}\build" `
110+
-D BUILD_DOCS=OFF `
111+
-D BUILD_TESTING=OFF `
112+
-D BUILD_TESTS=OFF `
113+
-D OPENCL_SDK_BUILD_SAMPLES=OFF `
114+
-D OPENCL_ICD_LOADER_BUILD_TESTING=OFF `
115+
-D CPACK_SOURCE_IGNORE_FILES="/\\.git/;/\\.gitignore;/\\.gitmodules;/\\.gitlab/;/\\.github/;/\\.reuse/;/\\.appveyor.yml;/build/;/install/;/package/"
116+
117+
- name: Package Source
118+
shell: pwsh
119+
run: |
120+
$Generator = if('${{matrix.OS}}' -match 'windows') {'ZIP'} else {'TGZ'}
121+
& cpack `
122+
--config "${env:GITHUB_WORKSPACE}\build\CPackSourceConfig.cmake" `
123+
-G $Generator `
124+
-C Release `
125+
-B "${env:GITHUB_WORKSPACE}\package"
126+
127+
- name: Release Source
128+
uses: softprops/action-gh-release@v1
129+
if: startsWith(github.ref, 'refs/tags/')
130+
with:
131+
draft: true
132+
files: |
133+
package/OpenCL-SDK-${{github.ref_name}}-Source.*

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cmake_minimum_required(VERSION 3.0)
1717
set(CMAKE_CXX_STANDARD 14)
1818

1919
project(OpenCL-SDK
20-
VERSION 1.0
20+
VERSION 2022.03.09
2121
LANGUAGES
2222
C CXX
2323
)
@@ -102,3 +102,5 @@ install(
102102
FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenCL/OpenCLConfigVersion.cmake
103103
DESTINATION ${config_package_location}
104104
)
105+
106+
include(CPack)

docs/.keepme

Whitespace-only changes.

docs/RELEASE.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Release process
2+
3+
To release a new version of the SDK, follow the process in a recursively cloned repo:
4+
5+
> Throughout the guide `<remote_name>` refers to the https://github.com/KhronosGroup hosted remotes. Your dev environment may not refer to these as `origin` but any other name, for eg. `upstream`. Update commands as needed.
6+
7+
## Checkout tip of main
8+
9+
With a clean workspace and empty stage, issue the following.
10+
11+
```
12+
git pull <remote_name>
13+
git checkout <remote_name>/main
14+
```
15+
16+
## Update submodules
17+
18+
Should tip of main have updated submodule remotes, the SDK needs those changes. (This part likely does nothing.)
19+
20+
```
21+
git submodule update --remote
22+
```
23+
24+
## Tag OpenCL projects
25+
26+
In the external folder, tag the OpenCL-related projects with the current date using `vYYYY.MM.DD` format in dep order.
27+
28+
1. OpenCL-Headers
29+
2. OpenCL-ICD-Loader
30+
3. OpenCL-CLHPP
31+
32+
> Note: the aim is that OpenCL-Layers in time will become a submodule/component of the SDK
33+
34+
In each of these repos, issue:
35+
36+
```
37+
git pull origin
38+
git checkout origin/main
39+
git tag vYYYY.MM.DD
40+
git push origin vYYYY.MM.DD
41+
```
42+
43+
> Note 1: Remote name `origin` isn't an oversight, the default remote name for submodules is `origin`.
44+
>
45+
> Note 2: Compatibility between packages is guaranteed manually. CI for each project fetches newest `main` and not using the same tag. Pushing tags in dep order is important to guarantee that when CI runs on pushing tags in these repos, tests are run using the correct versions of their deps.
46+
47+
## Update submodule hashes
48+
49+
Submodules may have moved to a different commit hash due to the previous step. The SDK wants to pick up all those changes (if it hasn't already been done). If `git status` shows, changes, push the changes.
50+
51+
```
52+
git commit -a -m "Bump submodules hashes"
53+
```
54+
55+
## Update project version
56+
57+
Update the project version in CMake
58+
59+
```cmake
60+
project(OpenCL-SDK
61+
VERSION YYYY.MM.DD
62+
```
63+
64+
```
65+
git commit -a -m "Update project version"
66+
```
67+
68+
## Tag SDK
69+
70+
```
71+
git tag vYYYY.MM.DD
72+
git push <remote_name> vYYYY.MM.DD
73+
```

0 commit comments

Comments
 (0)