Skip to content

Commit

Permalink
ci: .
Browse files Browse the repository at this point in the history
  • Loading branch information
SHIINASAMA committed Sep 25, 2024
1 parent 6beea2d commit a714816
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/macos-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Setup Python
uses: actions/[email protected]
with:
python-version: '3.11'

- name: Setup portfile.cmake
run: |
pip install -r ${{ github.workspace }}/requirements.txt
python ${{ github.workspace }}/scripts/update_portfile.py
- name: Config
working-directory: ${{ github.workspace }}/package
run: >
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/ubuntu-2204-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Setup Python
uses: actions/[email protected]
with:
python-version: '3.11'

- name: Setup portfile.cmake
run: |
pip install -r ${{ github.workspace }}/requirements.txt
python ${{ github.workspace }}/scripts/update_portfile.py
- name: Config
working-directory: ${{ github.workspace }}/package
run: >
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/windows-2022-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Setup Python
uses: actions/[email protected]
with:
python-version: '3.11'

- name: Setup portfile.cmake
run: |
pip install -r ${{ github.workspace }}/requirements.txt
python ${{ github.workspace }}/scripts/update_portfile.py
- name: Config
working-directory: ${{ github.workspace }}/package
run: >
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if (WIN32 OR SESE_AUTO_VCPKG)
sese_auto_find_vcpkg()
endif ()

project(sese VERSION 2.2.1)
project(sese VERSION 2.3.0)
# for cxx 20 modules
# set(CMAKE_CXX_EXTENSIONS OFF)
# set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ docker build -f docker/ubuntu-arm64.dockerfile .

对于一些可能难以测试的函数或分支,最好是添加详细的注释表明此处为何没有做到覆盖,可能存在的风险,以及出现该情况的应对方案。

## 发行流程

此部分规范适用于项目核心管理人员,需要严格安装下列操作进行

1. 变更项目版本号,修改 `CMakeLists.txt``vcpkg.json`,提交将会自动触发 `update_portfile.py`,等待 CI 测试结果。
2. 打上 tag 等待 CI 自动发版。

## 联系方式

对部分代码存在疑问或者是其它问题时,你可以先尝试联系代码片段的贡献者以获取帮助。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ set(SOURCE_PATH ${CURRENT_BUILDTRESS_DIR}/sese)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libsese/sese
REF 2f90c4394ede28cea89b167bcf08b394839e26bd
SHA512 0302d53e22fec63cd1f886e65163120e49efd4392a7043ea8525f90210f69edb7e35000b9b3a9f9055e6250fec3ba9a898b44b81488f5886cd2e3a517b0143c1
REF @@REF@@
SHA512 @@SHA512@@
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import os
import subprocess
import requests
import hashlib

from pygments.lexers.robotframework import Variable

# 获取最新的 commit hash
result = subprocess.run(['git', '-C', '.', '--no-pager', 'log', '-1', '--pretty=format:%H'], stdout=subprocess.PIPE)
hash_code = result.stdout.decode('utf-8').strip()
Expand All @@ -19,4 +22,21 @@

# 输出结果
print(f"commit hash {hash_code}")
print(f"archive hash {archive_hash_code}")
print(f"archive hash {archive_hash_code}")

variables = {
'REF': hash_code,
'SHA512': archive_hash_code
}

current_dir = os.path.dirname(__file__)
with open(os.path.join(current_dir, '../package/ports/sese/portfile.cmake.in'), 'r') as infile:
template = infile.read()

for key, value in variables.items():
template = template.replace(f'@@{key}@@', value)

with open(os.path.join(current_dir, '../package/ports/sese/portfile.cmake'), 'w') as outfile:
outfile.write(template)

print('ok')
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sese",
"version": "2.2.1",
"version": "2.3.0",
"description": "A cross-platform framework for basic components.",
"homepage": "https://github.com/libsese/sese",
"license": "Apache-2.0",
Expand Down

0 comments on commit a714816

Please sign in to comment.